pub struct SettleAnimation { /* private fields */ }Expand description
Drives a critically-damped spring toward a settle target on a scroll container, taking over the gesture’s release velocity so a policy-adjusted rest position still reads as one continuous deceleration.
Implementations§
Source§impl SettleAnimation
impl SettleAnimation
pub fn new(runtime: RuntimeHandle) -> Self
Sourcepub fn start_settle<F, G>(
&self,
initial_value: f32,
initial_velocity: f32,
target: f32,
on_scroll: F,
on_end: G,
)
pub fn start_settle<F, G>( &self, initial_value: f32, initial_velocity: f32, target: f32, on_scroll: F, on_end: G, )
Starts settling from initial_value (with initial_velocity, in
offset units/sec) toward target. on_scroll receives per-frame
deltas and returns the consumed amount; on_end fires once when the
spring rests or the target stops consuming (boundary hit).
pub fn cancel(&self)
pub fn is_running(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SettleAnimation
impl !Send for SettleAnimation
impl !Sync for SettleAnimation
impl !UnwindSafe for SettleAnimation
impl Freeze for SettleAnimation
impl Unpin for SettleAnimation
impl UnsafeUnpin for SettleAnimation
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