pub struct LayerTransform {
pub affine: Affine,
}Expand description
The transform applied to a layer (Primitive::Layer) at compositing time:
an arbitrary Affine (translation, per-axis scale, rotation, or any
composition of them) in screen pixels. The layer is first rendered flat into
a texture, as with group opacity, then composited transformed — so a single
pass transforms a whole subtree (rects, text, images) without touching any
individual primitive’s shaders.
Fields§
§affine: AffineThe local (flat) → screen transform.
Implementations§
Source§impl LayerTransform
impl LayerTransform
Sourcepub fn rotation(angle: f32, pivot: Point) -> Self
pub fn rotation(angle: f32, pivot: Point) -> Self
A rotation of angle radians about pivot, in screen pixels.
Sourcepub fn scaled(self, factor: f32) -> Self
pub fn scaled(self, factor: f32) -> Self
Conjugates the transform by a scale, so it follows Primitive::scaled:
S ∘ M ∘ S⁻¹, which is what makes a DPI change scale the whole layer, its
transform included.
Sourcepub fn scaled_xy(self, sx: f32, sy: f32) -> Self
pub fn scaled_xy(self, sx: f32, sy: f32) -> Self
Like LayerTransform::scaled, but per axis.
Sourcepub fn translated(self, dx: f32, dy: f32) -> Self
pub fn translated(self, dx: f32, dy: f32) -> Self
Conjugates by a translation, so it follows Primitive::translated.