summaryrefslogtreecommitdiffstats
path: root/core/src/angle.rs
diff options
context:
space:
mode:
authorLibravatar Gigas002 <24297712+Gigas002@users.noreply.github.com>2024-03-19 22:09:36 +0900
committerLibravatar GitHub <noreply@github.com>2024-03-19 22:09:36 +0900
commitf3a1c785b2743e9c48c3d28df0c6772ce579d7c8 (patch)
tree1b39799f45878d89b4f9e2f9bea8fa8a7ed07150 /core/src/angle.rs
parentc9453cd55d84f0dd2ad0050208863d036c98843f (diff)
parent8ce16aba6204cb5c02a709cdf79c309f7b7e0196 (diff)
downloadiced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.gz
iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.bz2
iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.zip
Merge branch 'iced-rs:master' into viewer_content_fit
Diffstat (limited to 'core/src/angle.rs')
-rw-r--r--core/src/angle.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/src/angle.rs b/core/src/angle.rs
index 30ddad83..dc3c0e93 100644
--- a/core/src/angle.rs
+++ b/core/src/angle.rs
@@ -7,6 +7,18 @@ use std::ops::{Add, AddAssign, Div, Mul, RangeInclusive, Sub, SubAssign};
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct Degrees(pub f32);
+impl PartialEq<f32> for Degrees {
+ fn eq(&self, other: &f32) -> bool {
+ self.0.eq(other)
+ }
+}
+
+impl PartialOrd<f32> for Degrees {
+ fn partial_cmp(&self, other: &f32) -> Option<std::cmp::Ordering> {
+ self.0.partial_cmp(other)
+ }
+}
+
/// Radians
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct Radians(pub f32);
@@ -140,3 +152,15 @@ impl Div for Radians {
Self(self.0 / rhs.0)
}
}
+
+impl PartialEq<f32> for Radians {
+ fn eq(&self, other: &f32) -> bool {
+ self.0.eq(other)
+ }
+}
+
+impl PartialOrd<f32> for Radians {
+ fn partial_cmp(&self, other: &f32) -> Option<std::cmp::Ordering> {
+ self.0.partial_cmp(other)
+ }
+}