mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Animate NonNegativeLength as its inner type
This commit is contained in:
parent
52f0fcabad
commit
d8c43ac855
3 changed files with 19 additions and 20 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue