pub struct LayerTransform {
pub affine: Affine,
}Expand description
What a layer does at compositing, for painting a scene by hand.
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 const fn new(affine: Affine) -> LayerTransform
pub const fn new(affine: Affine) -> LayerTransform
Wraps any Affine.
Sourcepub fn rotation(angle: f32, pivot: Point) -> LayerTransform
pub fn rotation(angle: f32, pivot: Point) -> LayerTransform
A rotation of angle radians about pivot, in screen pixels.
Sourcepub fn scaled(self, factor: f32) -> LayerTransform
pub fn scaled(self, factor: f32) -> LayerTransform
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) -> LayerTransform
pub fn scaled_xy(self, sx: f32, sy: f32) -> LayerTransform
Like LayerTransform::scaled, but per axis.
Sourcepub fn translated(self, dx: f32, dy: f32) -> LayerTransform
pub fn translated(self, dx: f32, dy: f32) -> LayerTransform
Conjugates by a translation, so it follows Primitive::translated.
Trait Implementations§
Source§impl Clone for LayerTransform
impl Clone for LayerTransform
Source§fn clone(&self) -> LayerTransform
fn clone(&self) -> LayerTransform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more