pub struct HoverManager { /* private fields */ }Expand description
Manages hover state history for all input points
Records hit test results for mouse and touch inputs over multiple frames:
DragStartdetection (requires movement threshold over multiple frames)- Hover-over event detection
- Multi-touch gesture detection
- Input path analysis
The manager maintains a separate history for each active input point.
Implementations§
Source§impl HoverManager
impl HoverManager
Sourcepub fn debug_counts(&self) -> (usize, usize)
pub fn debug_counts(&self) -> (usize, usize)
(input points, total history entries across all points). Used by
AZ_E2E_TEST to watch for unbounded growth.
Sourcepub fn push_hit_test(&mut self, input_id: InputPointId, hit_test: FullHitTest)
pub fn push_hit_test(&mut self, input_id: InputPointId, hit_test: FullHitTest)
Push a new hit test result for a specific input point
The most recent result is always at index 0 for that input point. If the history is full, the oldest frame is dropped.
Sourcepub fn remove_input_point(&mut self, input_id: &InputPointId)
pub fn remove_input_point(&mut self, input_id: &InputPointId)
Remove an input point’s history (e.g., when touch ends)
Sourcepub fn get_current(&self, input_id: &InputPointId) -> Option<&FullHitTest>
pub fn get_current(&self, input_id: &InputPointId) -> Option<&FullHitTest>
Get the most recent hit test result for an input point
Returns None if no hit tests have been recorded for this input point.
Sourcepub fn get_current_mouse(&self) -> Option<&FullHitTest>
pub fn get_current_mouse(&self) -> Option<&FullHitTest>
Get the most recent mouse cursor hit test (convenience method)
Sourcepub fn get_frame(
&self,
input_id: &InputPointId,
frames_ago: usize,
) -> Option<&FullHitTest>
pub fn get_frame( &self, input_id: &InputPointId, frames_ago: usize, ) -> Option<&FullHitTest>
Get the hit test result from N frames ago for an input point (0 = current frame)
Returns None if the requested frame is not in history.
Sourcepub fn get_history(
&self,
input_id: &InputPointId,
) -> Option<&VecDeque<FullHitTest>>
pub fn get_history( &self, input_id: &InputPointId, ) -> Option<&VecDeque<FullHitTest>>
Get the entire hover history for an input point (most recent first)
Sourcepub fn get_active_input_points(&self) -> Vec<InputPointId>
pub fn get_active_input_points(&self) -> Vec<InputPointId>
Get all currently tracked input points
Sourcepub fn frame_count(&self, input_id: &InputPointId) -> usize
pub fn frame_count(&self, input_id: &InputPointId) -> usize
Get the number of frames in history for an input point
Sourcepub fn purge_dom(&mut self, dom_id: &DomId)
pub fn purge_dom(&mut self, dom_id: &DomId)
Purge every recorded hit-test entry for dom_id across all input
points and all history frames.
Called when a VirtualView child DOM is rebuilt IN PLACE (fresh NodeIds,
no reconcile mapping — e.g. a MapWidget pan rebuilding the tile grid):
the recorded hits for that DOM reference the OLD generation’s NodeIds,
and consumers that resolve them against the NEW styled DOM read out of
bounds (the hit_test.rs cursor panic: “len is 25 but the index is 27”)
or target the wrong node. Unlike incremental reconciles there is no
NodeId map to remap with, so the only safe option is to forget that
DOM’s hits; the next pointer move re-populates them from a fresh
hit test.
Sourcepub fn has_sufficient_history_for_gestures(
&self,
input_id: &InputPointId,
) -> bool
pub fn has_sufficient_history_for_gestures( &self, input_id: &InputPointId, ) -> bool
Check if we have enough frames for gesture detection on an input point
DragStart detection requires analyzing movement over multiple frames.
This returns true if we have at least 2 frames of history.
Sourcepub fn any_has_sufficient_history_for_gestures(&self) -> bool
pub fn any_has_sufficient_history_for_gestures(&self) -> bool
Check if any input point has enough history for gesture detection
Sourcepub fn current_hover_node(&self) -> Option<NodeId>
pub fn current_hover_node(&self) -> Option<NodeId>
Get the deepest hovered node from the current mouse hit test.
Returns the NodeId of the most specific (deepest in DOM tree) node
that the mouse cursor is currently over, or None if not hovering anything.
NOTE: Assumes single-DOM architecture (uses DomId { inner: 0 }).
Sourcepub fn previous_hover_node(&self) -> Option<NodeId>
pub fn previous_hover_node(&self) -> Option<NodeId>
Get the deepest hovered node from the previous frame’s mouse hit test.
Returns the NodeId from one frame ago, or None if not hovering anything
or no previous frame exists.
NOTE: Assumes single-DOM architecture (uses DomId { inner: 0 }).
Sourcepub fn current_hover_node_full(&self) -> Option<DomNodeId>
pub fn current_hover_node_full(&self) -> Option<DomNodeId>
Multi-DOM aware: the deepest hovered node across ALL hit DOMs (current
frame). Returns a full DomNodeId so events can target VirtualView /
iframe child DOMs, not just the root.
Selection rule: prefer the most-nested DOM that was hit. Child DOMs
(VirtualView / iframe content) always have higher DomIds than their
host and are composited on top of it, so the highest hit DomId is the
front-most surface. Within that DOM the deepest node (last in NodeId
order) is the W3C event target; bubbling then reaches ancestor handlers.
For single-DOM apps only DomId 0 is ever hit, so this is equivalent to
[current_hover_node] wrapped in DomId { inner: 0 }.
Sourcepub fn previous_hover_node_full(&self) -> Option<DomNodeId>
pub fn previous_hover_node_full(&self) -> Option<DomNodeId>
Multi-DOM aware counterpart of [previous_hover_node] (one frame ago).
Trait Implementations§
Source§impl Clone for HoverManager
impl Clone for HoverManager
Source§fn clone(&self) -> HoverManager
fn clone(&self) -> HoverManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HoverManager
impl Debug for HoverManager
Source§impl Default for HoverManager
impl Default for HoverManager
impl Eq for HoverManager
Source§impl NodeIdRemap for HoverManager
impl NodeIdRemap for HoverManager
Source§fn remap_node_ids(&mut self, dom_id: DomId, map: &NodeIdMap)
fn remap_node_ids(&mut self, dom_id: DomId, map: &NodeIdMap)
Remap NodeIds in all hover histories after DOM reconciliation.
Hits on unmounted nodes are dropped (they cannot be hovered any more) — keeping them would make the hover history describe a node that no longer exists at that index.
Source§impl PartialEq for HoverManager
impl PartialEq for HoverManager
impl StructuralPartialEq for HoverManager
Auto Trait Implementations§
impl Freeze for HoverManager
impl RefUnwindSafe for HoverManager
impl Send for HoverManager
impl Sync for HoverManager
impl Unpin for HoverManager
impl UnsafeUnpin for HoverManager
impl UnwindSafe for HoverManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more