use super::Empty;
pub trait Rotate: Sized {
fn inner_rotate(self, rotate: f32) -> Rotation;
}
#[doc(hidden)]
#[derive(Copy, Clone, Default)]
pub struct Rotation(f32);
impl Rotation {
pub(crate) const fn new(rotation: f32) -> Self {
Self(rotation)
}
#[inline]
#[must_use]
pub(crate) const fn value(self) -> f32 {
self.0
}
}
impl Rotate for Rotation {
#[inline]
fn inner_rotate(mut self, rotate: f32) -> Rotation {
self.0 += rotate;
self
}
}
impl Rotate for Empty {
#[inline]
fn inner_rotate(self, rotate: f32) -> Rotation {
Rotation::new(rotate)
}
}