pub struct Transform2D {
pub previous: Option<Box<Transform2D>>,
pub rotate: Option<Rotation>,
pub translate: Option<[Size; 2]>,
pub anchor: Option<[Size; 2]>,
pub scale: Option<[Size; 2]>,
pub skew: Option<[Rotation; 2]>,
}
Expand description
A sugary representation of an Affine transform+, including
anchor
and align
as layout-computed properties.
translate
represents an (x,y) affine translation
scale
represents an (x,y) non-uniform affine scale
rotate
represents a (z) affine rotation (intuitive 2D rotation)
anchor
represents the “(0,0)” point of the render node as it relates to its own bounding box.
By default that’s the top-left of the element, but anchor
allows that
to be offset either by a pixel or percentage-of-element-size
for each of (x,y)
Fields§
§previous: Option<Box<Transform2D>>
Keeps track of a linked list of previous Transform2Ds, assembled e.g. via multiplication
rotate: Option<Rotation>
Rotation is single-dimensional for 2D rendering, representing rotation over z axis
translate: Option<[Size; 2]>
§anchor: Option<[Size; 2]>
§scale: Option<[Size; 2]>
§skew: Option<[Rotation; 2]>
Implementations§
Source§impl Transform2D
impl Transform2D
Trait Implementations§
Source§impl Clone for Transform2D
impl Clone for Transform2D
Source§fn clone(&self) -> Transform2D
fn clone(&self) -> Transform2D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl CoercionRules for Transform2D
impl CoercionRules for Transform2D
Source§impl Debug for Transform2D
impl Debug for Transform2D
Source§impl Default for Transform2D
impl Default for Transform2D
Source§fn default() -> Transform2D
fn default() -> Transform2D
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Transform2D
impl<'de> Deserialize<'de> for Transform2D
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 Interpolatable for Transform2D
impl Interpolatable for Transform2D
fn interpolate(&self, _other: &Self, _t: f64) -> Self
Source§impl Mul for Transform2D
impl Mul for Transform2D
Source§impl Serialize for Transform2D
impl Serialize for Transform2D
Source§impl ToPaxValue for Transform2D
impl ToPaxValue for Transform2D
fn to_pax_value(self) -> PaxValue
Auto Trait Implementations§
impl Freeze for Transform2D
impl RefUnwindSafe for Transform2D
impl Send for Transform2D
impl Sync for Transform2D
impl Unpin for Transform2D
impl UnwindSafe for Transform2D
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,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.