summaryrefslogtreecommitdiffstats
path: root/core/src/point.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-07 23:45:54 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-07 23:45:54 +0100
commitb74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68 (patch)
treed05e074ad1a57309ae1ed09f49fee1cbb78a6ea6 /core/src/point.rs
parent37f0d97159d81dbd4801e287a06f4e243e483269 (diff)
downloadiced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.gz
iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.bz2
iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.zip
Implement `Primitive::Cached`
Diffstat (limited to 'core/src/point.rs')
-rw-r--r--core/src/point.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/point.rs b/core/src/point.rs
index b9a8149c..b55f5099 100644
--- a/core/src/point.rs
+++ b/core/src/point.rs
@@ -46,3 +46,14 @@ impl std::ops::Add<Vector> for Point {
}
}
}
+
+impl std::ops::Sub<Vector> for Point {
+ type Output = Self;
+
+ fn sub(self, vector: Vector) -> Self {
+ Self {
+ x: self.x - vector.x,
+ y: self.y - vector.y,
+ }
+ }
+}