Skip to main content

PointerHitTest

Trait PointerHitTest 

Source
pub trait PointerHitTest {
    // Required methods
    fn hit_interaction(
        &self,
        store: &NodeStore,
        x: f32,
        y: f32,
    ) -> Option<NodeId>;
    fn hit_painted(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>;
    fn overlay_contains(
        &self,
        store: &NodeStore,
        ro: ResolvedOverlay,
        x: f32,
        y: f32,
    ) -> bool;
}
Expand description

The geometry queries the stage needs. Backends with paint-accurate state (live animated transforms, the painted stacking plan) implement it over their own hit test.

Required Methods§

Source

fn hit_interaction(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>

The deepest interaction target at (x, y) (falling back to any event target).

Source

fn hit_painted(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>

The deepest painted node at (x, y), unfiltered (the top-layer press hit).

Source

fn overlay_contains( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, ) -> bool

Whether (x, y) lies inside the (transform-aware) box of open overlay ro.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§