pub struct ScrollAnimation {
pub duration_secs: f32,
pub easing: Easing,
}Expand description
Configuration for animated scrolling.
When attached to an EnsureVisibleConfig, the scrollable will smoothly
animate to the target position using the configured Easing curve.
Fields§
§duration_secs: f32Duration of the animation in seconds.
easing: EasingThe easing curve applied to the animation.
Implementations§
Source§impl ScrollAnimation
impl ScrollAnimation
Sourcepub fn new(duration_secs: f32) -> ScrollAnimation
pub fn new(duration_secs: f32) -> ScrollAnimation
Creates a new animation with the given duration in seconds
and the default easing (Easing::EaseOutCubic).
Sourcepub const fn with_easing(self, easing: Easing) -> ScrollAnimation
pub const fn with_easing(self, easing: Easing) -> ScrollAnimation
Sets the easing curve for this animation.
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§fn default() -> ScrollAnimation
fn default() -> ScrollAnimation
Default animation: 0.3 seconds with ease-out cubic.
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