use crate::values::computed::basic_shape::BasicShape;
use crate::values::computed::url::ComputedUrl;
use crate::values::computed::{Angle, LengthPercentage, Position};
use crate::values::generics::motion::{
GenericOffsetPath, GenericOffsetPathFunction, GenericOffsetPosition, GenericRayFunction,
};
use crate::Zero;
pub type RayFunction = GenericRayFunction<Angle, Position>;
pub type OffsetPathFunction = GenericOffsetPathFunction<BasicShape, RayFunction, ComputedUrl>;
pub type OffsetPath = GenericOffsetPath<OffsetPathFunction>;
pub type OffsetPosition = GenericOffsetPosition<LengthPercentage, LengthPercentage>;
#[inline]
fn is_auto_zero_angle(auto: &bool, angle: &Angle) -> bool {
*auto && angle.is_zero()
}
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
Deserialize,
MallocSizeOf,
PartialEq,
Serialize,
ToAnimatedValue,
ToAnimatedZero,
ToCss,
ToResolvedValue,
)]
#[repr(C)]
pub struct OffsetRotate {
#[animation(constant)]
#[css(represents_keyword)]
pub auto: bool,
#[css(contextual_skip_if = "is_auto_zero_angle")]
pub angle: Angle,
}
impl OffsetRotate {
#[inline]
pub fn auto() -> Self {
OffsetRotate {
auto: true,
angle: Zero::zero(),
}
}
}