Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils/geometry: Implement Mul<N> for Size<N, Kind>
Browse files Browse the repository at this point in the history
ids1024 committed Dec 31, 2024
1 parent 5af799e commit ac6b9a1
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
@@ -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 {

0 comments on commit ac6b9a1

Please sign in to comment.