pub struct ExponentialDecaySpec { /* private fields */ }Expand description
Exponential decay animation spec matching UIScrollView’s deceleration.
initial_velocity and the values returned by get_velocity_from_nanos
are in points/sec (Cranpose’s velocity-tracker convention throughout the
gesture pipeline); internally the law is evaluated in points/ms, which is
the unit UIScrollView.DecelerationRate and
scrollViewWillEndDragging(_:withVelocity:targetContentOffset:) use.
Implementations§
Source§impl ExponentialDecaySpec
impl ExponentialDecaySpec
Sourcepub fn new(rate: f32) -> Self
pub fn new(rate: f32) -> Self
Creates a decay spec for the given per-millisecond decay rate
(e.g. IOS_DECELERATION_RATE_NORMAL).
Trait Implementations§
Source§impl Clone for ExponentialDecaySpec
impl Clone for ExponentialDecaySpec
Source§fn clone(&self) -> ExponentialDecaySpec
fn clone(&self) -> ExponentialDecaySpec
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 moreimpl Copy for ExponentialDecaySpec
Source§impl Debug for ExponentialDecaySpec
impl Debug for ExponentialDecaySpec
Source§impl Default for ExponentialDecaySpec
impl Default for ExponentialDecaySpec
Source§impl FloatDecayAnimationSpec for ExponentialDecaySpec
impl FloatDecayAnimationSpec for ExponentialDecaySpec
Source§fn abs_velocity_threshold(&self) -> f32
fn abs_velocity_threshold(&self) -> f32
Velocity threshold below which animation is considered finished.
Source§fn get_value_from_nanos(
&self,
play_time_nanos: i64,
initial_value: f32,
initial_velocity: f32,
) -> f32
fn get_value_from_nanos( &self, play_time_nanos: i64, initial_value: f32, initial_velocity: f32, ) -> f32
Get position at a given time.
Source§fn get_velocity_from_nanos(
&self,
play_time_nanos: i64,
_initial_value: f32,
initial_velocity: f32,
) -> f32
fn get_velocity_from_nanos( &self, play_time_nanos: i64, _initial_value: f32, initial_velocity: f32, ) -> f32
Get velocity at a given time.
Auto Trait Implementations§
impl Freeze for ExponentialDecaySpec
impl RefUnwindSafe for ExponentialDecaySpec
impl Send for ExponentialDecaySpec
impl Sync for ExponentialDecaySpec
impl Unpin for ExponentialDecaySpec
impl UnsafeUnpin for ExponentialDecaySpec
impl UnwindSafe for ExponentialDecaySpec
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