pub struct HitTester {
pub stats: HitTestStats,
}
Expand description
Hit testing engine for determining event targets from layout
Fields§
§stats: HitTestStats
Performance statistics
Implementations§
Source§impl HitTester
impl HitTester
Sourcepub fn hit_test(
&mut self,
point: Point,
layout_root: &LayoutNode,
) -> Result<Vec<ComponentId>, EventError>
pub fn hit_test( &mut self, point: Point, layout_root: &LayoutNode, ) -> Result<Vec<ComponentId>, EventError>
Perform hit testing to find all components at the given point Returns components in order from top-most to bottom-most
Sourcepub fn hit_test_depth_first(
&mut self,
point: Point,
layout_root: &LayoutNode,
) -> Result<Vec<ComponentId>, EventError>
pub fn hit_test_depth_first( &mut self, point: Point, layout_root: &LayoutNode, ) -> Result<Vec<ComponentId>, EventError>
Perform hit testing with depth-first search (alternative algorithm)
Sourcepub fn hit_test_top(
&mut self,
point: Point,
layout_root: &LayoutNode,
) -> Result<Option<ComponentId>, EventError>
pub fn hit_test_top( &mut self, point: Point, layout_root: &LayoutNode, ) -> Result<Option<ComponentId>, EventError>
Find the top-most component at the given point
Sourcepub fn hit_test_region(
&mut self,
region: Rect,
layout_root: &LayoutNode,
) -> Result<Vec<ComponentId>, EventError>
pub fn hit_test_region( &mut self, region: Rect, layout_root: &LayoutNode, ) -> Result<Vec<ComponentId>, EventError>
Find all components within a rectangular region
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset hit testing statistics
Sourcepub fn get_stats(&self) -> &HitTestStats
pub fn get_stats(&self) -> &HitTestStats
Get hit testing statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HitTester
impl RefUnwindSafe for HitTester
impl Send for HitTester
impl Sync for HitTester
impl Unpin for HitTester
impl UnwindSafe for HitTester
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more