mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
style: Use the standalone struct and enum for the flags in SVG path.
We define the standalone types for using derive macro easily and overriding the behaviors of this traits. This could avoid defining the general behavior of booleans. Depends on D4788 Differential Revision: https://phabricator.services.mozilla.com/D4813
This commit is contained in:
parent
b0604c9be5
commit
31fc6cd565
3 changed files with 102 additions and 131 deletions
|
@ -141,20 +141,6 @@ impl Animate for f64 {
|
|||
}
|
||||
}
|
||||
|
||||
/// This is only used in SVG PATH. We return Err(()) if the flags are mismatched.
|
||||
// FIXME: Bug 653928: If we want to do interpolation on the flags in Arc, we have to update this
|
||||
// because `absolute`, `large_arc_flag`, and `sweep_flag` are using this implementation for now.
|
||||
impl Animate for bool {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, _procedure: Procedure) -> Result<Self, ()> {
|
||||
if *self == *other {
|
||||
Ok(*other)
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Animate for Option<T>
|
||||
where
|
||||
T: Animate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue