mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
Move specified and computed angles to submodules
This commit is contained in:
parent
4d10d39e8f
commit
1bd12bf91a
5 changed files with 279 additions and 238 deletions
|
@ -867,27 +867,6 @@ impl Animatable for i32 {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
impl Animatable for Angle {
|
||||
#[inline]
|
||||
fn add_weighted(&self, other: &Angle, self_portion: f64, other_portion: f64) -> Result<Self, ()> {
|
||||
match (*self, *other) {
|
||||
% for angle_type in [ 'Degree', 'Gradian', 'Turn' ]:
|
||||
(Angle::${angle_type}(val1), Angle::${angle_type}(val2)) => {
|
||||
Ok(Angle::${angle_type}(
|
||||
try!(val1.add_weighted(&val2, self_portion, other_portion))
|
||||
))
|
||||
}
|
||||
% endfor
|
||||
_ => {
|
||||
self.radians()
|
||||
.add_weighted(&other.radians(), self_portion, other_portion)
|
||||
.map(Angle::from_radians)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-visibility
|
||||
impl Animatable for Visibility {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue