pub struct ScrollBounceMotion { /* private fields */ }Expand description
Motion tokens for ScrollBounce: how far a drag stretches the viewport
past an edge, and how quickly a released edge returns.
Base plays the stretch and the return; the feel belongs to the caller.
The default is tuned to feel like a UIScrollView bounce.
Implementations§
Source§impl ScrollBounceMotion
impl ScrollBounceMotion
Sourcepub fn with_tracking(self, tracking: f32) -> Self
pub fn with_tracking(self, tracking: f32) -> Self
Fraction of finger travel the stretched edge follows at first.
The edge follows less and less as it approaches the viewport height, which it never reaches. Tracking is independent of the return, so slowing the return does not change how the finger feels.
§Panics
Panics when tracking is not finite or not positive.
Sourcepub fn with_response(self, response: Duration) -> Self
pub fn with_response(self, response: Duration) -> Self
Time scale of the return once the finger lifts.
Read the way crate::Spring::new reads its response: the period one
full oscillation would take without damping, which is the scale the
return is felt at rather than the moment it stops. The return is
critically damped, so it never crosses the edge. A zero response snaps
the edge back on the spot.
Trait Implementations§
Source§impl Clone for ScrollBounceMotion
impl Clone for ScrollBounceMotion
Source§fn clone(&self) -> ScrollBounceMotion
fn clone(&self) -> ScrollBounceMotion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScrollBounceMotion
Source§impl Debug for ScrollBounceMotion
impl Debug for ScrollBounceMotion
Source§impl Default for ScrollBounceMotion
impl Default for ScrollBounceMotion
Source§impl PartialEq for ScrollBounceMotion
impl PartialEq for ScrollBounceMotion
impl StructuralPartialEq for ScrollBounceMotion
Auto Trait Implementations§
impl Freeze for ScrollBounceMotion
impl RefUnwindSafe for ScrollBounceMotion
impl Send for ScrollBounceMotion
impl Sync for ScrollBounceMotion
impl Unpin for ScrollBounceMotion
impl UnsafeUnpin for ScrollBounceMotion
impl UnwindSafe for ScrollBounceMotion
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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().