add missing AddAssign<Size> and SubAssign<Size> traits for Point
@@ -148,6 +148,13 @@ impl Add<Size> for Point {
}
}
+impl AddAssign<Size> for Point {
+ fn add_assign(&mut self, rhs: Size) {
+ self.x += rhs.width;
+ self.y += rhs.height;
+ }
+}
+
impl Sub for Point {
type Output = Point;
fn sub(self, rhs: Self) -> Self {
@@ -169,6 +176,13 @@ impl Sub<Size> for Point {
}
}
+impl SubAssign<Size> for Point {
+ fn sub_assign(&mut self, rhs: Size) {
+ self.x -= rhs.width;
+ self.y -= rhs.height;
+ }
+}
+
impl Mul<scalar> for Point {
type Output = Self;
fn mul(self, rhs: scalar) -> Self {
