Function pick_element_at

Source
pub fn pick_element_at(
    snapshot: &DebugSnapshot,
    point: impl Into<DebugPoint>,
) -> Option<u64>
Expand description

Returns the topmost laid-out node containing a logical viewport point.

Nodes are inspected in reverse snapshot order, which prefers later siblings and descendants from the pre-order collection. A candidate must pass its own bounds/clip and every available ancestor clip. Missing ancestor records stop clip traversal permissively. Complexity is O(nodes + ancestor depth).

ยงExamples

use ailloli_ui_devtools_core::{pick_element_at, DebugPoint, DebugSnapshot};
fn pick(snapshot: &DebugSnapshot) -> Option<u64> {
    pick_element_at(snapshot, DebugPoint { x: 40.0, y: 20.0 })
}