mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
e49dbc4dfa
commit
eaf2f1ec33
5 changed files with 59 additions and 52 deletions
|
@ -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, ()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue