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:
Boris Chiou 2018-09-07 22:25:59 +00:00 committed by Emilio Cobos Álvarez
parent b0604c9be5
commit 31fc6cd565
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 102 additions and 131 deletions

View file

@ -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,