pub struct HoverStabilizer { /* private fields */ }Expand description
Stateful hover stabilizer that prevents jitter-induced target flicker.
Feed hit-test results via update and read
the stabilized target from current_target.
Implementations§
Source§impl HoverStabilizer
impl HoverStabilizer
Sourcepub fn new(config: HoverStabilizerConfig) -> Self
pub fn new(config: HoverStabilizerConfig) -> Self
Create a new hover stabilizer with the given configuration.
Sourcepub fn update(
&mut self,
hit_target: Option<u64>,
pos: (u16, u16),
now: Instant,
) -> Option<u64>
pub fn update( &mut self, hit_target: Option<u64>, pos: (u16, u16), now: Instant, ) -> Option<u64>
Sourcepub fn current_target(&self) -> Option<u64>
pub fn current_target(&self) -> Option<u64>
Get the current stabilized hover target.
Sourcepub fn switch_count(&self) -> u64
pub fn switch_count(&self) -> u64
Get the number of target switches (diagnostic).
Sourcepub fn config(&self) -> &HoverStabilizerConfig
pub fn config(&self) -> &HoverStabilizerConfig
Get a reference to the current configuration.
Sourcepub fn set_config(&mut self, config: HoverStabilizerConfig)
pub fn set_config(&mut self, config: HoverStabilizerConfig)
Update the configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HoverStabilizer
impl RefUnwindSafe for HoverStabilizer
impl Send for HoverStabilizer
impl Sync for HoverStabilizer
impl Unpin for HoverStabilizer
impl UnsafeUnpin for HoverStabilizer
impl UnwindSafe for HoverStabilizer
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
Mutably borrows from an owned value. Read more