pub struct BouncingScrollSimulation { /* private fields */ }Expand description
iOS’s fling: exponential friction while the position is in range, handing over to a rubber-band spring at whichever edge the fling reaches.
Implementations§
Source§impl BouncingScrollSimulation
impl BouncingScrollSimulation
Sourcepub const MAX_SPRING_TRANSFER_VELOCITY: f64 = 5000.0
pub const MAX_SPRING_TRANSFER_VELOCITY: f64 = 5000.0
The fastest velocity handed to an edge spring. A fling arriving faster transfers this instead, so an arbitrarily hard flick cannot turn into an arbitrarily deep bounce.
Sourcepub const FRICTION_DRAG: f64 = 0.135
pub const FRICTION_DRAG: f64 = 0.135
The friction phase’s drag: UIScrollView’s normal deceleration rate is
0.998 per millisecond, and 0.998^1000 ≈ 0.135 per second.
Sourcepub fn new(
position: f64,
velocity: f64,
leading_extent: f64,
trailing_extent: f64,
spring: SpringDescription,
tolerance: Tolerance,
constant_deceleration: f64,
) -> Self
pub fn new( position: f64, velocity: f64, leading_extent: f64, trailing_extent: f64, spring: SpringDescription, tolerance: Tolerance, constant_deceleration: f64, ) -> Self
A fling from position at velocity px/s within
leading_extent..=trailing_extent, bouncing off whichever edge it
reaches (or starting mid-bounce if position is already outside).
Trait Implementations§
Source§impl Clone for BouncingScrollSimulation
impl Clone for BouncingScrollSimulation
Source§impl Debug for BouncingScrollSimulation
impl Debug for BouncingScrollSimulation
Auto Trait Implementations§
impl Freeze for BouncingScrollSimulation
impl RefUnwindSafe for BouncingScrollSimulation
impl Send for BouncingScrollSimulation
impl Sync for BouncingScrollSimulation
impl Unpin for BouncingScrollSimulation
impl UnsafeUnpin for BouncingScrollSimulation
impl UnwindSafe for BouncingScrollSimulation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.