summaryrefslogtreecommitdiffstats
path: root/core/src/rotation.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-03 07:23:55 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-03 07:23:55 +0200
commit4010e3983d40e24a5d7b590d8fec9801651199ce (patch)
treee0deb67cf993a2b67417d7e764c0685f03b50ddf /core/src/rotation.rs
parenteac5bcb64f17dfbb52b64ea4f95693462986bb69 (diff)
downloadiced-4010e3983d40e24a5d7b590d8fec9801651199ce.tar.gz
iced-4010e3983d40e24a5d7b590d8fec9801651199ce.tar.bz2
iced-4010e3983d40e24a5d7b590d8fec9801651199ce.zip
Add `spin` mode to `ferris` example :crab:
Diffstat (limited to 'core/src/rotation.rs')
-rw-r--r--core/src/rotation.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/rotation.rs b/core/src/rotation.rs
index 00a8c302..afa8d79e 100644
--- a/core/src/rotation.rs
+++ b/core/src/rotation.rs
@@ -31,6 +31,13 @@ impl Rotation {
}
}
+ /// Returns a mutable reference to the angle of the [`Rotation`] in [`Radians`].
+ pub fn radians_mut(&mut self) -> &mut Radians {
+ match self {
+ Rotation::Floating(radians) | Rotation::Solid(radians) => radians,
+ }
+ }
+
/// Returns the angle of the [`Rotation`] in [`Degrees`].
pub fn degrees(self) -> Degrees {
Degrees(self.radians().0.to_degrees())