From d46be20d6e61a72a5836f9e51ddf8f732bb3e55c Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 10 Nov 2021 22:01:39 +0100 Subject: [PATCH] Add SubAssign for Size --- src/utils/geometry.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/geometry.rs b/src/utils/geometry.rs index 45652e4..50a84e2 100644 --- a/src/utils/geometry.rs +++ b/src/utils/geometry.rs @@ -637,6 +637,14 @@ impl AddAssign for Size { } } +impl SubAssign for Size { + #[inline] + fn sub_assign(&mut self, rhs: Self) { + self.w -= rhs.w; + self.h -= rhs.h + } +} + impl Clone for Size { #[inline] fn clone(&self) -> Self {