summaryrefslogtreecommitdiffstats
path: root/core/src/point.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-03-09 00:48:51 +0100
committerLibravatar GitHub <noreply@github.com>2020-03-09 00:48:51 +0100
commit5a91b52ef4066701d82a897b44a3f90412f210d2 (patch)
tree13d58d144c3ddf05e44c72557bf2af2194207bf3 /core/src/point.rs
parent29219500b7144f31dbf50fcc64653f7d2ce806d0 (diff)
parentb4f970ee7317297615848cd12f422c0cd2889f60 (diff)
downloadiced-5a91b52ef4066701d82a897b44a3f90412f210d2.tar.gz
iced-5a91b52ef4066701d82a897b44a3f90412f210d2.tar.bz2
iced-5a91b52ef4066701d82a897b44a3f90412f210d2.zip
Merge pull request #214 from artursapek/artur/canvas-text
Implement text support in canvas 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,
+ }
+ }
+}