pub struct ViewportTransform {
pub tx: f64,
pub ty: f64,
pub sx: f64,
pub sy: f64,
pub rotation: f64,
}Expand description
Viewport transformation matrix
Fields§
§tx: f64Translation X
ty: f64Translation Y
sx: f64Scale X
sy: f64Scale Y
rotation: f64Rotation angle in radians
Implementations§
Source§impl ViewportTransform
impl ViewportTransform
Sourcepub const fn new(
sx: f64,
_shy: f64,
_shx: f64,
sy: f64,
tx: f64,
ty: f64,
) -> Self
pub const fn new( sx: f64, _shy: f64, _shx: f64, sy: f64, tx: f64, ty: f64, ) -> Self
Creates a new transform with specified parameters (affine matrix form) Parameters: sx, shy, shx, sy, tx, ty (2D affine transform) For simpler cases, use identity(), translate(), scale(), or rotate()
Sourcepub const fn uniform_scale(s: f64) -> Self
pub const fn uniform_scale(s: f64) -> Self
Creates a uniform scale transform
Trait Implementations§
Source§impl Clone for ViewportTransform
impl Clone for ViewportTransform
Source§fn clone(&self) -> ViewportTransform
fn clone(&self) -> ViewportTransform
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 Debug for ViewportTransform
impl Debug for ViewportTransform
Source§impl Default for ViewportTransform
impl Default for ViewportTransform
Source§impl PartialEq for ViewportTransform
impl PartialEq for ViewportTransform
impl Copy for ViewportTransform
impl StructuralPartialEq for ViewportTransform
Auto Trait Implementations§
impl Freeze for ViewportTransform
impl RefUnwindSafe for ViewportTransform
impl Send for ViewportTransform
impl Sync for ViewportTransform
impl Unpin for ViewportTransform
impl UnsafeUnpin for ViewportTransform
impl UnwindSafe for ViewportTransform
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