pub trait RenderScene {
type HitTarget: HitTestTarget + Clone;
// Required methods
fn clear(&mut self);
fn hit_test(&self, x: f32, y: f32) -> Vec<Self::HitTarget>;
fn find_target(&self, node_id: NodeId) -> Option<Self::HitTarget>;
// Provided method
fn hit_test_nodes(&self, x: f32, y: f32) -> Vec<NodeId> ⓘ { ... }
}Expand description
Trait describing the minimal surface area required by the application shell to process pointer events and refresh the frame graph.
Required Associated Types§
type HitTarget: HitTestTarget + Clone
Required Methods§
fn clear(&mut self)
Sourcefn hit_test(&self, x: f32, y: f32) -> Vec<Self::HitTarget>
fn hit_test(&self, x: f32, y: f32) -> Vec<Self::HitTarget>
Performs hit testing at the given coordinates. Returns hit targets ordered by z-index (top-to-bottom).
Sourcefn find_target(&self, node_id: NodeId) -> Option<Self::HitTarget>
fn find_target(&self, node_id: NodeId) -> Option<Self::HitTarget>
Finds a hit target by NodeId with fresh geometry from the current scene.
This is the key method for HitPathTracker-style gesture handling:
- On PointerDown, we cache NodeIds (not geometry)
- On Move/Up/Cancel, we call this to get fresh HitTarget with current geometry
- Handler closures are preserved (same Rc), so internal state survives
Returns None if the node no longer exists in the scene (e.g., removed during gesture).
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".