mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
Derive the most trivial Animate impls
This commit is contained in:
parent
faaf31411a
commit
7ee124b1ed
20 changed files with 168 additions and 314 deletions
|
@ -122,7 +122,7 @@
|
|||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
% if need_animatable or animation_value_type == "ComputedValue":
|
||||
#[derive(ComputeSquaredDistance)]
|
||||
#[derive(Animate, ComputeSquaredDistance)]
|
||||
% endif
|
||||
pub struct T(
|
||||
% if allow_empty and allow_empty != "NotInitial":
|
||||
|
@ -133,14 +133,7 @@
|
|||
);
|
||||
|
||||
% if need_animatable or animation_value_type == "ComputedValue":
|
||||
use values::animated::{Animate, Procedure, ToAnimatedZero};
|
||||
|
||||
impl Animate for T {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
Ok(T(self.0.animate(&other.0, procedure)?))
|
||||
}
|
||||
}
|
||||
use values::animated::{ToAnimatedZero};
|
||||
|
||||
impl ToAnimatedZero for T {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue