pub struct Matrix {
pub a: f64,
pub b: f64,
pub c: f64,
pub d: f64,
pub e: f64,
pub f: f64,
}Expand description
2D affine transformation matrix: [a b c d e f] Represents the transform: x’ = ax + cy + e, y’ = bx + dy + f
Fields§
§a: f64Horizontal scaling component.
b: f64Horizontal skewing component.
c: f64Vertical skewing component.
d: f64Vertical scaling component.
e: f64Horizontal translation.
f: f64Vertical translation.
Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn multiply(&self, other: &Matrix) -> Matrix
pub fn multiply(&self, other: &Matrix) -> Matrix
Multiply this matrix by another: self × other.
Sourcepub fn transform_point(&self, x: f64, y: f64) -> (f64, f64)
pub fn transform_point(&self, x: f64, y: f64) -> (f64, f64)
Transform a point (x, y) by this matrix.
Sourcepub fn font_size_factor(&self) -> f64
pub fn font_size_factor(&self) -> f64
Get the effective font size (vertical scaling factor).
Trait Implementations§
impl Copy for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnsafeUnpin for Matrix
impl UnwindSafe for Matrix
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> 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