diff options
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, + } + } +} |