pub trait HitTestTarget {
// Required methods
fn dispatch(&self, event: PointerEvent);
fn node_id(&self) -> NodeId;
// Provided methods
fn dispatch_with_applier(
&self,
_applier: &mut MemoryApplier,
event: PointerEvent,
) { ... }
fn capture_path(&self) -> Vec<NodeId> ⓘ { ... }
}Expand description
Trait implemented by hit-test targets stored inside a RenderScene.
Required Methods§
Sourcefn dispatch(&self, event: PointerEvent)
fn dispatch(&self, event: PointerEvent)
Dispatches a pointer event to this target’s handlers.
Provided Methods§
Sourcefn dispatch_with_applier(
&self,
_applier: &mut MemoryApplier,
event: PointerEvent,
)
fn dispatch_with_applier( &self, _applier: &mut MemoryApplier, event: PointerEvent, )
Dispatches a pointer event using the current live node state when available.
Render-scene hit targets may cache closures from an older scene build. Pointer dispatch goes through this hook so implementations can resolve fresh handlers from the current applier while still using the target’s geometry snapshot.
Sourcefn capture_path(&self) -> Vec<NodeId> ⓘ
fn capture_path(&self) -> Vec<NodeId> ⓘ
Returns the node capture path that should stay attached to this target’s gesture.
The default is just this target’s own node. Renderers can override this to include stable ancestor pointer-input nodes that must continue receiving Move/Up/Cancel even if the original descendant target is recycled.