Struct iced_core::Transformation
source · pub struct Transformation(/* private fields */);
Expand description
A 2D transformation matrix.
Implementations§
source§impl Transformation
impl Transformation
sourcepub const IDENTITY: Self = _
pub const IDENTITY: Self = _
A Transformation
that preserves whatever is transformed.
sourcepub fn orthographic(width: u32, height: u32) -> Transformation
pub fn orthographic(width: u32, height: u32) -> Transformation
Creates an orthographic projection.
sourcepub fn translate(x: f32, y: f32) -> Transformation
pub fn translate(x: f32, y: f32) -> Transformation
Creates a translate transformation.
sourcepub fn scale(scaling: f32) -> Transformation
pub fn scale(scaling: f32) -> Transformation
Creates a uniform scaling transformation.
sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Returns the scale factor of the Transformation
.
sourcepub fn translation(&self) -> Vector
pub fn translation(&self) -> Vector
Returns the translation of the Transformation
.
Trait Implementations§
source§impl Clone for Transformation
impl Clone for Transformation
source§fn clone(&self) -> Transformation
fn clone(&self) -> Transformation
Returns a copy 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 Debug for Transformation
impl Debug for Transformation
source§impl From<Transformation> for Mat4
impl From<Transformation> for Mat4
source§fn from(transformation: Transformation) -> Self
fn from(transformation: Transformation) -> Self
Converts to this type from the input type.
source§impl Mul<Transformation> for Point
impl Mul<Transformation> for Point
source§impl Mul<Transformation> for Rectangle
impl Mul<Transformation> for Rectangle
source§impl Mul<Transformation> for Size
impl Mul<Transformation> for Size
source§impl Mul<Transformation> for Vector
impl Mul<Transformation> for Vector
source§impl Mul for Transformation
impl Mul for Transformation
source§impl PartialEq for Transformation
impl PartialEq for Transformation
source§fn eq(&self, other: &Transformation) -> bool
fn eq(&self, other: &Transformation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Transformation
impl StructuralPartialEq for Transformation
Auto Trait Implementations§
impl RefUnwindSafe for Transformation
impl Send for Transformation
impl Sync for Transformation
impl Unpin for Transformation
impl UnwindSafe for Transformation
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