pub enum TransformLength {
Pixels(f32),
Fraction(f32),
}Expand description
One axis of a TransformSpec’s translate().
Variants§
Pixels(f32)
An absolute length in LOGICAL (CSS) pixels.
Fraction(f32)
A fraction of the element’s own border box on this axis: -50% is
-0.5. This is the unit translate(-50%, -50%) centring idiom is
written in, and it cannot be resolved before layout.
Implementations§
Source§impl TransformLength
impl TransformLength
Sourcepub fn interpolate(self, other: Self, t: f32) -> Self
pub fn interpolate(self, other: Self, t: f32) -> Self
Interpolates between two authored lengths.
Same units interpolate. Mixed units cannot without knowing the box, and
CSS would produce a calc() there — except when one side is zero, which
is the same length in both units and so adopts the other’s. Anything
else snaps at the halfway point, which is the discrete behaviour the
rest of this animator already uses for uninterpolable pairs.
Trait Implementations§
Source§impl Clone for TransformLength
impl Clone for TransformLength
impl Copy for TransformLength
Source§impl Debug for TransformLength
impl Debug for TransformLength
Source§impl<'de> Deserialize<'de> for TransformLength
impl<'de> Deserialize<'de> for TransformLength
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransformLength
impl PartialEq for TransformLength
Source§impl Serialize for TransformLength
impl Serialize for TransformLength
impl StructuralPartialEq for TransformLength
Auto Trait Implementations§
impl Forget for TransformLength
impl Freeze for TransformLength
impl Move for TransformLength
impl RefUnwindSafe for TransformLength
impl Send for TransformLength
impl Sync for TransformLength
impl Unpin for TransformLength
impl UnsafeUnpin for TransformLength
impl UnwindSafe for TransformLength
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more