From ac6b9a1593604d513cc576775be0350dedde4a5f Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 31 Dec 2024 09:02:30 -0800 Subject: [PATCH] utils/geometry: Implement `Mul for Size` --- src/utils/geometry.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/utils/geometry.rs b/src/utils/geometry.rs index 827d7584be95..d899f3b28be4 100644 --- a/src/utils/geometry.rs +++ b/src/utils/geometry.rs @@ -983,6 +983,19 @@ impl, KindLhs, KindRhs> Div> fo } } +impl Mul for Size { + type Output = Size<::Output, Kind>; + + #[inline] + fn mul(self, rhs: N) -> Self::Output { + Size { + w: self.w * rhs, + h: self.h * rhs, + _kind: std::marker::PhantomData, + } + } +} + impl Clone for Size { #[inline] fn clone(&self) -> Self {