mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Clean up transform animations
This commit is contained in:
parent
181f41ed37
commit
baf3597477
2 changed files with 288 additions and 281 deletions
|
@ -9,6 +9,7 @@ use std::{f32, f64, fmt};
|
|||
use std::f64::consts::PI;
|
||||
use style_traits::ToCss;
|
||||
use values::CSSFloat;
|
||||
use values::animated::ToAnimatedZero;
|
||||
use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
|
||||
/// A computed angle.
|
||||
|
@ -87,6 +88,18 @@ impl Animatable for Angle {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToAnimatedZero for Angle {
|
||||
#[inline]
|
||||
fn to_animated_zero(&self) -> Result<Self, ()> {
|
||||
match *self {
|
||||
Angle::Degree(value) => Ok(Angle::Degree(value.to_animated_zero()?)),
|
||||
Angle::Gradian(value) => Ok(Angle::Gradian(value.to_animated_zero()?)),
|
||||
Angle::Radian(value) => Ok(Angle::Radian(value.to_animated_zero()?)),
|
||||
Angle::Turn(value) => Ok(Angle::Turn(value.to_animated_zero()?)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ComputeSquaredDistance for Angle {
|
||||
#[inline]
|
||||
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue