pub struct LayerTransform {
pub x: f32,
pub y: f32,
pub scale_x: f32,
pub scale_y: f32,
pub rotation: f32,
}Expand description
2D affine transform parameters for a compositor layer.
All values use UV-space coordinates where 0.0 is no change. The default (identity) transform leaves the layer centred and unscaled.
Fields§
§x: f32Horizontal UV-space offset (positive = shift right). Default: 0.0.
y: f32Vertical UV-space offset (positive = shift down). Default: 0.0.
scale_x: f32Horizontal scale factor (1.0 = no change). Default: 1.0.
scale_y: f32Vertical scale factor (1.0 = no change). Default: 1.0.
rotation: f32Counter-clockwise rotation in radians. Default: 0.0.
Implementations§
Source§impl LayerTransform
impl LayerTransform
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Returns true when this transform is the identity (no visual change).
Trait Implementations§
Source§impl Clone for LayerTransform
impl Clone for LayerTransform
Source§fn clone(&self) -> LayerTransform
fn clone(&self) -> LayerTransform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LayerTransform
impl Debug for LayerTransform
Auto Trait Implementations§
impl Freeze for LayerTransform
impl RefUnwindSafe for LayerTransform
impl Send for LayerTransform
impl Sync for LayerTransform
impl Unpin for LayerTransform
impl UnsafeUnpin for LayerTransform
impl UnwindSafe for LayerTransform
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