pub struct Spring {
pub stiffness: f32,
pub damping: f32,
}Expand description
The spring a Cx::spring value follows its target on, as Qt’s
SpringAnimation. Time is in seconds and distance in the value’s own
units. The target pulls the value with stiffness times the distance,
per second squared, and friction slows it as damping says, as a
ratio: 1 comes to rest as fast as it can without passing the target,
less overshoots and bounces, more creeps in. The default, 700 and 0.9,
is Material 3’s default spatial spring; its expressive one is 380 and
0.8.
Fields§
§stiffness: f32How hard the target pulls, per second squared: higher is faster.
damping: f32The damping ratio: 1 never passes the target, less bounces.
Implementations§
Trait Implementations§
impl Copy for Spring
impl StructuralPartialEq for Spring
Auto Trait Implementations§
impl Forget for Spring
impl Freeze for Spring
impl Move for Spring
impl RefUnwindSafe for Spring
impl Send for Spring
impl Sync for Spring
impl Unpin for Spring
impl UnsafeUnpin for Spring
impl UnwindSafe for Spring
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