diff options
author | 2023-09-07 05:45:51 +0200 | |
---|---|---|
committer | 2023-09-07 05:45:51 +0200 | |
commit | 1f263051b6c2d2f2a02633d8a6277c772ae8e7f9 (patch) | |
tree | 6df6d652031ee57382218a388037dd4aeca2cb1e | |
parent | 5371fae21a4c1110a37e7183e794cba234598d9c (diff) | |
download | iced-1f263051b6c2d2f2a02633d8a6277c772ae8e7f9.tar.gz iced-1f263051b6c2d2f2a02633d8a6277c772ae8e7f9.tar.bz2 iced-1f263051b6c2d2f2a02633d8a6277c772ae8e7f9.zip |
Implement `scale` in terms of `scale_nonuniform`
-rw-r--r-- | tiny_skia/src/geometry.rs | 2 | ||||
-rw-r--r-- | wgpu/src/geometry.rs | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs index a416020f..ced5b408 100644 --- a/tiny_skia/src/geometry.rs +++ b/tiny_skia/src/geometry.rs @@ -155,7 +155,7 @@ impl Frame { } pub fn scale(&mut self, scale: f32) { - self.transform = self.transform.pre_scale(scale, scale); + self.scale_nonuniform(Vector { x: scale, y: scale }); } pub fn scale_nonuniform(&mut self, scale: Vector) { diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs index 2cd07a27..64b98469 100644 --- a/wgpu/src/geometry.rs +++ b/wgpu/src/geometry.rs @@ -447,9 +447,7 @@ impl Frame { /// Applies a uniform scaling to the current transform of the [`Frame`]. #[inline] pub fn scale(&mut self, scale: f32) { - self.transforms.current.raw = - self.transforms.current.raw.pre_scale(scale, scale); - self.transforms.current.is_identity = false; + self.scale_nonuniform(Vector { x: scale, y: scale }); } /// Applies a non-uniform scaling to the current transform of the [`Frame`]. |