Animate NonNegativeLength as its inner type

This commit is contained in:
Anthony Ramine 2018-02-15 10:54:03 +01:00
parent 52f0fcabad
commit d8c43ac855
3 changed files with 19 additions and 20 deletions

View file

@ -17,7 +17,6 @@ use values::computed::BorderCornerRadius as ComputedBorderCornerRadius;
use values::computed::ComputedUrl;
use values::computed::MaxLength as ComputedMaxLength;
use values::computed::MozLength as ComputedMozLength;
use values::computed::NonNegativeLength as ComputedNonNegativeLength;
use values::specified::url::SpecifiedUrl;
pub mod color;
@ -261,20 +260,6 @@ trivial_to_animated_value!(ComputedUrl);
trivial_to_animated_value!(bool);
trivial_to_animated_value!(f32);
impl ToAnimatedValue for ComputedNonNegativeLength {
type AnimatedValue = Self;
#[inline]
fn to_animated_value(self) -> Self {
self
}
#[inline]
fn from_animated_value(animated: Self::AnimatedValue) -> Self {
ComputedNonNegativeLength::new(animated.px().max(0.))
}
}
impl ToAnimatedValue for ComputedBorderCornerRadius {
type AnimatedValue = Self;