summaryrefslogtreecommitdiffstats
path: root/core/src/rotation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/rotation.rs')
-rw-r--r--core/src/rotation.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/rotation.rs b/core/src/rotation.rs
index ebb85f3c..f36ef089 100644
--- a/core/src/rotation.rs
+++ b/core/src/rotation.rs
@@ -1,5 +1,5 @@
//! Control the rotation of some content (like an image) within a space.
-use crate::{Radians, Size};
+use crate::{Degrees, Radians, Size};
/// The strategy used to rotate the content.
///
@@ -31,6 +31,11 @@ impl Rotation {
}
}
+ /// Returns the angle of the [`Rotation`] in [`Degrees`].
+ pub fn degrees(self) -> Degrees {
+ Degrees(self.radians().0.to_degrees())
+ }
+
/// Rotates the given [`Size`].
pub fn apply(self, size: Size) -> Size {
match self {