pub struct Velocity {
pub x: f32,
pub y: f32,
}Expand description
The shared animation layer — physics, curves, driver — see
frus_core::animation. Re-exported here so applications can reach it through
frus_widgets without depending on frus-core directly.
A pointer speed, in logical pixels per second.
Fields§
§x: f32The horizontal component, in logical pixels per second.
y: f32The vertical component, in logical pixels per second.
Implementations§
Source§impl Velocity
impl Velocity
Sourcepub fn new(x: f32, y: f32) -> Velocity
pub fn new(x: f32, y: f32) -> Velocity
A velocity with the given components, in logical pixels per second.
Sourcepub fn clamp_magnitude(self, min: f32, max: f32) -> Velocity
pub fn clamp_magnitude(self, min: f32, max: f32) -> Velocity
The same direction, with the speed brought into [min, max].
A gesture below min is sped up to it rather than dropped: callers that
want to drop it test the magnitude first.
Trait Implementations§
impl Copy for Velocity
impl StructuralPartialEq for Velocity
Auto Trait Implementations§
impl Freeze for Velocity
impl RefUnwindSafe for Velocity
impl Send for Velocity
impl Sync for Velocity
impl Unpin for Velocity
impl UnsafeUnpin for Velocity
impl UnwindSafe for Velocity
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