pub struct Scale { /* private fields */ }Expand description
Scale induced by relative input.
Implements Default and can be created with Scale::default().
Implementations§
Source§impl Scale
impl Scale
Sourcepub fn compute(&self, num: f32) -> f32
pub fn compute(&self, num: f32) -> f32
Computes scale ratio from relative value.
The ratio is exponential in the relative value num over the denominator, that is
exp(-num / den), so that a relative value equal to the denominator scales by 1 / e.
Hence, scaling in and out by the same relative value restores the distance and the ratio of
a relative value is the product of the ratios of its parts, regardless of how the input is
split into events or frames. The ratio is always positive.
Sourcepub const fn denominator(&self) -> f32
pub const fn denominator(&self) -> f32
Denominator. Default is scroll unit of 120.0.
Sourcepub const fn set_denominator(&mut self, den: f32)
pub const fn set_denominator(&mut self, den: f32)
Sets denominator. Default is scroll unit of 120.0.
Trait Implementations§
impl StructuralPartialEq for Scale
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnsafeUnpin for Scale
impl UnwindSafe for Scale
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