Create ferris example to showcase ContentFit and Rotation
This commit is contained in:
parent
610394b695
commit
efc55b655b
5 changed files with 234 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue