summaryrefslogtreecommitdiffstats
path: root/core/src/point.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-10 06:12:06 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-10 06:12:06 +0100
commite4fbca59b4b9478c9c5fa5eec9ebe31dc93412ad (patch)
tree237d2e5dd29c2d0f05f2b68f829425bb480b8ce7 /core/src/point.rs
parent6151c528241d0a6ece88e6e664df1b50f8174ecb (diff)
parent5a91b52ef4066701d82a897b44a3f90412f210d2 (diff)
downloadiced-e4fbca59b4b9478c9c5fa5eec9ebe31dc93412ad.tar.gz
iced-e4fbca59b4b9478c9c5fa5eec9ebe31dc93412ad.tar.bz2
iced-e4fbca59b4b9478c9c5fa5eec9ebe31dc93412ad.zip
Merge branch 'master' into feature/panes-widget
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,
+ }
+ }
+}