pub struct LayerTransform { /* private fields */ }Expand description
A backend-neutral transform applied while a retained layer is composited.
Values are quantized internally so animated transforms remain safe to compare and hash. The retained layer contents are not rerasterized when only this transform changes.
Implementations§
Source§impl LayerTransform
impl LayerTransform
pub const fn identity() -> Self
pub fn rotation_degrees(self, degrees: f32) -> Self
pub fn rotation_radians(self, radians: f32) -> Self
pub fn scale(self, scale: f32) -> Self
pub fn scale_xy(self, scale_x: f32, scale_y: f32) -> Self
Sourcepub fn translation(self, x: f32, y: f32) -> Self
pub fn translation(self, x: f32, y: f32) -> Self
Moves the composited layer without changing its retained contents.
Sourcepub fn origin(self, x: f32, y: f32) -> Self
pub fn origin(self, x: f32, y: f32) -> Self
Sets the transform origin in normalized layer coordinates.
pub fn rotation_degrees_f32(self) -> f32
pub fn rotation_radians_f32(self) -> f32
pub fn scale_x(self) -> f32
pub fn scale_y(self) -> f32
pub fn origin_x(self) -> f32
pub fn origin_y(self) -> f32
pub fn translation_x(self) -> f32
pub fn translation_y(self) -> f32
pub const fn is_identity(self) -> bool
pub fn transformed_bounds(self, rect: UiRect) -> UiRect
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 moreimpl Copy for LayerTransform
Source§impl Debug for LayerTransform
impl Debug for LayerTransform
Source§impl Default for LayerTransform
impl Default for LayerTransform
impl Eq for LayerTransform
Source§impl Hash for LayerTransform
impl Hash for LayerTransform
Source§impl PartialEq for LayerTransform
impl PartialEq for LayerTransform
impl StructuralPartialEq 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