Skip to main content

move_focus

Function move_focus 

Source
pub fn move_focus(scene: &Expr, ids_in_order: &[&str], dir: FocusDir) -> Expr
Expand description

Advances focus deterministically through ids_in_order, wrapping at the ends, and returns the re-annotated scene.

The current focus is located in ids_in_order and moved one step in dir; the order wraps, so FocusDir::Next past the last id lands on the first and FocusDir::Prev past the first lands on the last. When the scene has no focus yet (or its focus is not in the list), FocusDir::Next seeds the first id and FocusDir::Prev the last. An empty ids_in_order leaves the scene unchanged.