summaryrefslogtreecommitdiffstats
path: root/wgpu/src/geometry.rs
diff options
context:
space:
mode:
authorLibravatar ripytide <james.forsterer@gmail.com>2023-09-05 10:49:50 +0100
committerLibravatar ripytide <james.forsterer@gmail.com>2023-09-05 10:49:50 +0100
commit5371fae21a4c1110a37e7183e794cba234598d9c (patch)
treea76bbdccbeb23239b4cb5fff5f5e0cf483e21538 /wgpu/src/geometry.rs
parenta56b25b9096d47ada3c4349f5b91110dfaa92bf6 (diff)
downloadiced-5371fae21a4c1110a37e7183e794cba234598d9c.tar.gz
iced-5371fae21a4c1110a37e7183e794cba234598d9c.tar.bz2
iced-5371fae21a4c1110a37e7183e794cba234598d9c.zip
added a Frame::scale_nonuniform method
Diffstat (limited to 'wgpu/src/geometry.rs')
-rw-r--r--wgpu/src/geometry.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs
index e421e0b0..2cd07a27 100644
--- a/wgpu/src/geometry.rs
+++ b/wgpu/src/geometry.rs
@@ -444,7 +444,7 @@ impl Frame {
self.transforms.current.is_identity = false;
}
- /// Applies a scaling to the current transform of the [`Frame`].
+ /// Applies a uniform scaling to the current transform of the [`Frame`].
#[inline]
pub fn scale(&mut self, scale: f32) {
self.transforms.current.raw =
@@ -452,6 +452,14 @@ impl Frame {
self.transforms.current.is_identity = false;
}
+ /// Applies a non-uniform scaling to the current transform of the [`Frame`].
+ #[inline]
+ pub fn scale_nonuniform(&mut self, scale: Vector) {
+ self.transforms.current.raw =
+ self.transforms.current.raw.pre_scale(scale.x, scale.y);
+ self.transforms.current.is_identity = false;
+ }
+
/// Produces the [`Primitive`] representing everything drawn on the [`Frame`].
pub fn into_primitive(self) -> Primitive {
Primitive::Group {