Merge ComputeDistance trait into Animatable trait

This commit is contained in:
Brian Birtles 2017-05-10 14:41:26 +09:00
parent 4d25e87ac6
commit 6dfc1d1aa8
10 changed files with 481 additions and 684 deletions

View file

@ -2181,7 +2181,7 @@ ${helpers.single_keyword("transform-style",
use values::specified::{NoCalcLength, LengthOrPercentage, Percentage};
pub mod computed_value {
use properties::animated_properties::{Animatable, ComputeDistance};
use properties::animated_properties::Animatable;
use values::computed::{Length, LengthOrPercentage};
#[derive(Clone, Copy, Debug, PartialEq)]
@ -2201,9 +2201,7 @@ ${helpers.single_keyword("transform-style",
depth: try!(self.depth.interpolate(&other.depth, time)),
})
}
}
impl ComputeDistance for T {
#[inline]
fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
self.compute_squared_distance(other).map(|sd| sd.sqrt())