pub struct ManagedHitTester;Expand description
A hit tester that walks the visual tree directly.
A visual is hit when the point lies within its bounds. Subtrees are skipped when the visual is invisible, rejected by the filter, or clips its content to its bounds and the point lies outside of them, or has a clip geometry that does not contain the point. Children are tested before their parent and in front-to-back order: by descending Z index, then by descending position in the visual children.
Hit testing with a geometry follows the same rules with the geometry in place of the point: a visual is hit when the rectangle of its bounds and the geometry intersect, and the result tells how. It needs the geometry implementations of the render interface.
This is the fallback for presentation sources without a renderer-backed hit tester. It only knows about bounds: it does not look at what a visual actually draws, so a visual is hit anywhere within its bounds even where it draws nothing.
Implementations§
Trait Implementations§
Source§impl Clone for ManagedHitTester
impl Clone for ManagedHitTester
impl Copy for ManagedHitTester
Source§impl Debug for ManagedHitTester
impl Debug for ManagedHitTester
Source§impl Default for ManagedHitTester
impl Default for ManagedHitTester
Source§impl IHitTester for ManagedHitTester
impl IHitTester for ManagedHitTester
Source§fn hit_test(
&self,
p: Point,
root: &Visual,
filter: Option<&dyn Fn(&Visual) -> bool>,
) -> Vec<Ref<Visual>>
fn hit_test( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Vec<Ref<Visual>>
Source§fn hit_test_first(
&self,
p: Point,
root: &Visual,
filter: Option<&dyn Fn(&Visual) -> bool>,
) -> Option<Ref<Visual>>
fn hit_test_first( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Option<Ref<Visual>>
Auto Trait Implementations§
impl Freeze for ManagedHitTester
impl RefUnwindSafe for ManagedHitTester
impl Send for ManagedHitTester
impl Sync for ManagedHitTester
impl Unpin for ManagedHitTester
impl UnsafeUnpin for ManagedHitTester
impl UnwindSafe for ManagedHitTester
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more