diff options
author | 2020-03-07 23:45:54 +0100 | |
---|---|---|
committer | 2020-03-07 23:45:54 +0100 | |
commit | b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68 (patch) | |
tree | d05e074ad1a57309ae1ed09f49fee1cbb78a6ea6 /core/src/point.rs | |
parent | 37f0d97159d81dbd4801e287a06f4e243e483269 (diff) | |
download | iced-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.rs | 11 |
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, + } + } +} |