pub struct PressScaleSpec {
pub target_scale: f64,
pub spring: PressSpringId,
}Expand description
The optional press-scale spring spec a tappable surface may opt into:
the target scale to spring toward while pressed, and which named spring
drives it. Mirrors the reference’s M3ETappable.pressedScale + .spring
pair. See the module docs for why this is spec data only, with
no driving loop of its own.
Fields§
§target_scale: f64The scale factor to spring toward while pressed.
Self::DISABLED_SCALE disables press-scale entirely.
spring: PressSpringIdWhich named crate::tokens::motion_scheme() spring drives the
scale animation.
Implementations§
Source§impl PressScaleSpec
impl PressScaleSpec
Sourcepub const DISABLED_SCALE: f64 = 1.0
pub const DISABLED_SCALE: f64 = 1.0
The target_scale value that disables press-scale (mirrors the
reference’s pressedScale: 1).
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Whether this spec actually springs the surface
(target_scale != Self::DISABLED_SCALE).
Trait Implementations§
Source§impl Clone for PressScaleSpec
impl Clone for PressScaleSpec
impl Copy for PressScaleSpec
Source§impl Debug for PressScaleSpec
impl Debug for PressScaleSpec
Source§impl Default for PressScaleSpec
impl Default for PressScaleSpec
Source§fn default() -> Self
fn default() -> Self
Disabled (target_scale == 1.0), spring id irrelevant while
inactive — Self::DISABLED_SCALE with PressSpringId::FastSpatial
as an arbitrary but harmless placeholder.
Source§impl PartialEq for PressScaleSpec
impl PartialEq for PressScaleSpec
impl StructuralPartialEq for PressScaleSpec
Auto Trait Implementations§
impl Freeze for PressScaleSpec
impl RefUnwindSafe for PressScaleSpec
impl Send for PressScaleSpec
impl Sync for PressScaleSpec
impl Unpin for PressScaleSpec
impl UnsafeUnpin for PressScaleSpec
impl UnwindSafe for PressScaleSpec
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.