diff options
Diffstat (limited to 'core/src/rectangle.rs')
-rw-r--r-- | core/src/rectangle.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs index 4fe91519..c6e6fce4 100644 --- a/core/src/rectangle.rs +++ b/core/src/rectangle.rs @@ -111,6 +111,12 @@ impl Rectangle<f32> { } } +impl std::cmp::PartialOrd for Rectangle<f32> { + fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { + (self.width * self.height).partial_cmp(&(other.width * other.height)) + } +} + impl std::ops::Mul<f32> for Rectangle<f32> { type Output = Self; |