Skip to main content

hit_test_subtree

Function hit_test_subtree 

Source
pub fn hit_test_subtree(
    widget: &dyn Widget,
    local_pos: Point,
) -> Option<Vec<usize>>
Expand description

Walk the subtree rooted at widget and return the path (list of child indices) to the deepest widget that passes hit_test at local_pos.

local_pos is expressed in widget’s coordinate space (not including widget.bounds().x/y — the caller has already accounted for that).

Returns Some(vec![]) if widget itself is hit but no child is. Returns None if nothing is hit.