pub struct Transform {
pub rotate: Option<String>,
pub scale: Option<Scale>,
pub skew_x: Option<String>,
pub skew_y: Option<String>,
pub translate_x: Option<String>,
pub translate_y: Option<String>,
pub matrix: Option<[f64; 6]>,
pub origin: Option<TransformOrigin>,
}Expand description
2D transform for element positioning.
Transforms allow rotation, scaling, skewing, and translation of elements in paginated and precise layouts.
Fields§
§rotate: Option<String>Rotation angle (e.g., “90deg”, “-45deg”, “0.5rad”).
scale: Option<Scale>Scale factor (uniform or non-uniform).
skew_x: Option<String>Skew along X-axis (angle).
skew_y: Option<String>Skew along Y-axis (angle).
translate_x: Option<String>Translation along X-axis (length).
translate_y: Option<String>Translation along Y-axis (length).
matrix: Option<[f64; 6]>2D transformation matrix [a, b, c, d, tx, ty].
origin: Option<TransformOrigin>Transform origin point.
Implementations§
Source§impl Transform
impl Transform
Sourcepub fn scale_uniform(factor: f64) -> Self
pub fn scale_uniform(factor: f64) -> Self
Create a uniform scale transform.
Sourcepub fn translate(x: impl Into<String>, y: impl Into<String>) -> Self
pub fn translate(x: impl Into<String>, y: impl Into<String>) -> Self
Create a translation transform.
Sourcepub fn with_origin(self, origin: TransformOrigin) -> Self
pub fn with_origin(self, origin: TransformOrigin) -> Self
Set the transform origin.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Transform
impl<'de> Deserialize<'de> for Transform
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
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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