pub struct Transform {
pub xx: f32,
pub yx: f32,
pub xy: f32,
pub yy: f32,
pub dx: f32,
pub dy: f32,
}Fields§
§xx: f32§yx: f32§xy: f32§yy: f32§dx: f32§dy: f32Implementations§
Source§impl Transform
impl Transform
pub const IDENTITY: Transform
pub const fn new( xx: f32, yx: f32, xy: f32, yy: f32, dx: f32, dy: f32, ) -> Transform
pub const fn translation(x: f32, y: f32) -> Transform
pub const fn translation_vector(delta: Vector) -> Transform
pub const fn scale(x: f32, y: f32) -> Transform
pub fn rotation(radians: f32) -> Transform
pub const fn is_identity(self) -> bool
pub fn then(self, next: Transform) -> Transform
pub fn transform_point(self, point: Point) -> Point
pub fn transform_vector(self, vector: Vector) -> Vector
pub fn inverse(self) -> Option<Transform>
pub fn transform_rect_bbox(self, rect: Rect) -> Rect
Trait Implementations§
impl Copy for Transform
Source§impl From<Transform> for AnimationValue
impl From<Transform> for AnimationValue
Source§fn from(value: Transform) -> AnimationValue
fn from(value: Transform) -> AnimationValue
Converts to this type from the input type.
Source§impl Interpolate for Transform
Blends the translation, rotation, scale, and shear of two transforms
separately, the way CSS interpolates matrices. Blending the raw matrix
entries would shrink a rotating shape halfway through its turn. Rotation
takes the shorter way around. Degenerate transforms (zero scale) cannot be
decomposed and fall back to blending the matrix entries.
impl Interpolate for Transform
Blends the translation, rotation, scale, and shear of two transforms separately, the way CSS interpolates matrices. Blending the raw matrix entries would shrink a rotating shape halfway through its turn. Rotation takes the shorter way around. Degenerate transforms (zero scale) cannot be decomposed and fall back to blending the matrix entries.
fn interpolate(from: Transform, to: Transform, t: f32) -> Transform
Source§fn extrapolate(from: Transform, to: Transform, t: f32) -> Transform
fn extrapolate(from: Transform, to: Transform, t: f32) -> Transform
Like
Interpolate::interpolate, but lets t leave 0..=1 so a
spring can overshoot its target. Values that cannot extend past their
endpoints, such as colors, clamp instead.impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Forget for Transform
impl Freeze for Transform
impl Move for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.