summaryrefslogtreecommitdiffstats
path: root/core/src/rectangle.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-02 15:21:22 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-02 17:28:28 +0200
commita57313b23ecb9843856ca0ea08635b6121fcb2cb (patch)
tree42a88a4e42031ae99ae87aeb92fea85ab590b01e /core/src/rectangle.rs
parent09a6bcfffc24f5abdc8709403bab7ae1e01563f1 (diff)
downloadiced-a57313b23ecb9843856ca0ea08635b6121fcb2cb.tar.gz
iced-a57313b23ecb9843856ca0ea08635b6121fcb2cb.tar.bz2
iced-a57313b23ecb9843856ca0ea08635b6121fcb2cb.zip
Simplify image rotation API and its internals
Diffstat (limited to 'core/src/rectangle.rs')
-rw-r--r--core/src/rectangle.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs
index 2ab50137..fb66131a 100644
--- a/core/src/rectangle.rs
+++ b/core/src/rectangle.rs
@@ -227,3 +227,19 @@ where
}
}
}
+
+impl<T> std::ops::Mul<Vector<T>> for Rectangle<T>
+where
+ T: std::ops::Mul<Output = T> + Copy,
+{
+ type Output = Rectangle<T>;
+
+ fn mul(self, scale: Vector<T>) -> Self {
+ Rectangle {
+ x: self.x * scale.x,
+ y: self.y * scale.y,
+ width: self.width * scale.x,
+ height: self.height * scale.y,
+ }
+ }
+}