Struct pax_runtime_api::Transform2D
source · 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<[f64; 2]>,
pub skew: Option<[f64; 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<[f64; 2]>
§skew: Option<[f64; 2]>
Implementations§
source§impl Transform2D
impl Transform2D
sourcepub fn anchor(x: Size, y: Size) -> Self
pub fn anchor(x: Size, y: Size) -> Self
Describe alignment of the (0,0) position of this element as it relates to its own bounding box
pub fn default_wrapped() -> Rc<RefCell<dyn PropertyInstance<Self>>>
Trait Implementations§
source§impl Clone for Transform2D
impl Clone for Transform2D
source§fn clone(&self) -> Transform2D
fn clone(&self) -> Transform2D
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more