Skip to main content

ManagedHitTester

Struct ManagedHitTester 

Source
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§

Source§

impl ManagedHitTester

Source

pub const fn new() -> Self

Creates the hit tester.

Trait Implementations§

Source§

impl Clone for ManagedHitTester

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ManagedHitTester

Source§

impl Debug for ManagedHitTester

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ManagedHitTester

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl IHitTester for ManagedHitTester

Source§

fn hit_test( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Vec<Ref<Visual>>

Hit tests a location to find the visuals at the specified point, topmost first. Read more
Source§

fn hit_test_first( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Option<Ref<Visual>>

Hit tests a location to find the first (topmost) visual at the specified point. Read more
Source§

fn hit_test_geometry( &self, geometry: &Geometry, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Vec<GeometryHitTestResult>

Hit tests a geometry to find the visuals intersecting a region, topmost first. Read more
Source§

fn hit_test_first_geometry( &self, geometry: &Geometry, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Option<GeometryHitTestResult>

Hit tests a geometry to find the first (topmost) visual intersecting a region. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.