pub struct ScrollAnimation {
pub points_per_second: f32,
pub duration: Rangef,
}Expand description
Scroll animation configuration, used when programmatically scrolling somewhere (e.g. with [crate::Ui::scroll_to_cursor]).
The animation duration is calculated based on the distance to be scrolled via [ScrollAnimation::points_per_second]
and can be clamped to a min / max duration via [ScrollAnimation::duration].
Fields§
§points_per_second: f32With what speed should we scroll? (Default: 1000.0)
duration: RangefThe min / max scroll duration.
Implementations§
Trait Implementations§
Source§impl Clone for ScrollAnimation
impl Clone for ScrollAnimation
Source§fn clone(&self) -> ScrollAnimation
fn clone(&self) -> ScrollAnimation
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 ScrollAnimation
Source§impl Debug for ScrollAnimation
impl Debug for ScrollAnimation
Source§impl Default for ScrollAnimation
impl Default for ScrollAnimation
Source§impl PartialEq for ScrollAnimation
impl PartialEq for ScrollAnimation
impl StructuralPartialEq for ScrollAnimation
Auto Trait Implementations§
impl Freeze for ScrollAnimation
impl RefUnwindSafe for ScrollAnimation
impl Send for ScrollAnimation
impl Sync for ScrollAnimation
impl Unpin for ScrollAnimation
impl UnsafeUnpin for ScrollAnimation
impl UnwindSafe for ScrollAnimation
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