diff options
author | 2020-04-28 01:12:27 +0200 | |
---|---|---|
committer | 2020-04-28 01:12:27 +0200 | |
commit | 6c2e28d20e498526d1c6d624b4018e9392d0fb80 (patch) | |
tree | 79b367351ce0005980dd09f00262f828633bcd86 /core | |
parent | dc97d6f33e1e8f8c276fd1cf1d4ed12892ce3ec9 (diff) | |
download | iced-6c2e28d20e498526d1c6d624b4018e9392d0fb80.tar.gz iced-6c2e28d20e498526d1c6d624b4018e9392d0fb80.tar.bz2 iced-6c2e28d20e498526d1c6d624b4018e9392d0fb80.zip |
Implement `std::ops::Sub<Point>` for `Point`
Diffstat (limited to 'core')
-rw-r--r-- | core/src/point.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/point.rs b/core/src/point.rs index 2b5ad154..a31bf967 100644 --- a/core/src/point.rs +++ b/core/src/point.rs @@ -67,3 +67,11 @@ impl std::ops::Sub<Vector> for Point { } } } + +impl std::ops::Sub<Point> for Point { + type Output = Vector; + + fn sub(self, point: Point) -> Vector { + Vector::new(self.x - point.x, self.y - point.y) + } +} |