FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SpringScalarNaturalMotionAnimation

    struct · ferroui-base · v0.5.0

    struct SpringScalarNaturalMotionAnimation
    

    A spring animation of scalar values (WinUI SpringScalarNaturalMotionAnimation): each component moves on a damped harmonic oscillator of the given damping ratio and period.

    View source

    Members

    new

    fn new(compositor: &Rc<Compositor>) -> Rc<SpringScalarNaturalMotionAnimation>
    

    Source

    damping_ratio

    fn damping_ratio(self: &Self) -> f32
    

    The damping ratio of the spring: 1 (the default) comes to rest as fast as possible without overshooting, less overshoots and oscillates, more comes to rest slower; 0 oscillates forever.

    Source

    set_damping_ratio

    fn set_damping_ratio(self: &Self, value: f32)
    

    Sets the damping ratio. Panics when it is negative or not a number.

    Source

    period

    fn period(self: &Self) -> Duration
    

    The period of the oscillation of the spring without damping; a shorter period is a stiffer spring.

    Source

    set_period

    fn set_period(self: &Self, value: Duration)
    

    Sets the period. Panics when it is zero.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ErasedDestructor
    • IntoEither
    • Deref
    • ICompositionAnimationBase
    • ICompositionAnimation
    • AsCompositionObject

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.