pub struct KineticScrollState {
pub velocity: f32,
pub last_pos: Option<Pos2>,
pub last_time: Option<Instant>,
pub is_active: bool,
pub anim_last_time: Option<Instant>,
}Expand description
Tracks kinetic (momentum-based) scrolling after a flick gesture.
When the user drags and releases quickly (trackpad or touch), the chart continues to scroll with decaying velocity, providing a natural “flick” feel. The velocity is measured in pixels per second and decays each frame using the configurable damping coefficient.
Fields§
§velocity: f32Current scroll velocity in pixels/second (positive = scrolling right).
last_pos: Option<Pos2>Last pointer position during drag (for velocity calculation).
last_time: Option<Instant>Timestamp of the last pointer sample.
is_active: boolWhether kinetic animation is currently running.
anim_last_time: Option<Instant>Last animation frame time (for delta-time calculation).
Implementations§
Trait Implementations§
Source§impl Clone for KineticScrollState
impl Clone for KineticScrollState
Source§fn clone(&self) -> KineticScrollState
fn clone(&self) -> KineticScrollState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KineticScrollState
impl Debug for KineticScrollState
Auto Trait Implementations§
impl Freeze for KineticScrollState
impl RefUnwindSafe for KineticScrollState
impl Send for KineticScrollState
impl Sync for KineticScrollState
impl Unpin for KineticScrollState
impl UnsafeUnpin for KineticScrollState
impl UnwindSafe for KineticScrollState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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