Introduce #[animation(constant)] for the Animate trait

This allows us to handle fields that should be the same during animations.
This commit is contained in:
Anthony Ramine 2017-08-25 23:51:12 +02:00
parent e49dbc4dfa
commit eaf2f1ec33
5 changed files with 59 additions and 52 deletions

View file

@ -139,21 +139,6 @@ impl ToAnimatedValue for ComputedTextShadowList {
}
}
// FIXME(nox): This could be derived if we implement Animate for bool.
impl Animate for BoxShadow {
#[inline]
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
if self.inset != other.inset {
return Err(());
}
Ok(BoxShadow {
base: self.base.animate(&other.base, procedure)?,
spread: self.spread.animate(&other.spread, procedure)?,
inset: self.inset,
})
}
}
impl ComputeSquaredDistance for BoxShadow {
#[inline]
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {