diff options
| author | 2024-03-16 17:09:00 +0100 | |
|---|---|---|
| committer | 2024-03-16 17:09:00 +0100 | |
| commit | 503a48e89977437bf8b7bf485f416a15a2e83ed0 (patch) | |
| tree | 30306bbaee7a31090ace9d7725d46c2c0027fe6b /core | |
| parent | 0524e9b4571d264018656418f02a1f9e27e268d7 (diff) | |
| parent | cfc0383bbfff083786840e3f1fd499e5991fa629 (diff) | |
| download | iced-503a48e89977437bf8b7bf485f416a15a2e83ed0.tar.gz iced-503a48e89977437bf8b7bf485f416a15a2e83ed0.tar.bz2 iced-503a48e89977437bf8b7bf485f416a15a2e83ed0.zip | |
Merge pull request #2331 from iced-rs/program-api
`Program` API
Diffstat (limited to 'core')
| -rw-r--r-- | core/src/angle.rs | 24 | 
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) +    } +} | 
