Skip to content

Commit

Permalink
utils/geometry: Implement Mul<N> for Size<N, Kind>
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Jan 2, 2025
1 parent adb9185 commit 1fbac76
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/utils/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,19 @@ impl<N: Coordinate + Div<Output = N>, KindLhs, KindRhs> Div<Size<N, KindRhs>> fo
}
}

impl<N: Coordinate + Mul, Kind> Mul<N> for Size<N, Kind> {
type Output = Size<<N as Mul>::Output, Kind>;

#[inline]
fn mul(self, rhs: N) -> Self::Output {
Size {
w: self.w * rhs,
h: self.h * rhs,
_kind: std::marker::PhantomData,
}
}
}

impl<N: Clone, Kind> Clone for Size<N, Kind> {
#[inline]
fn clone(&self) -> Self {
Expand Down

0 comments on commit 1fbac76

Please sign in to comment.