diff --git a/src/point.rs b/src/point.rs index 67730a60..14340c39 100644 --- a/src/point.rs +++ b/src/point.rs @@ -46,6 +46,12 @@ impl> Add, Point2D> for Point2D { } } +impl> Add, Point2D> for Point2D { + fn add(&self, other: &Size2D) -> Point2D { + Point2D(self.x + other.width, self.y + other.height) + } +} + impl> Point2D { pub fn add_size(&self, other: &Size2D) -> Point2D { Point2D { x: self.x + other.width, y: self.y + other.height }