Derive ComputeSquaredDistance

This commit is contained in:
Anthony Ramine 2017-08-13 00:50:36 +02:00
parent 51b740033b
commit 277351da35
22 changed files with 162 additions and 391 deletions

View file

@ -7,7 +7,6 @@
use properties::animated_properties::Animatable;
use values::animated::ToAnimatedZero;
use values::computed::{Length, LengthOrPercentage, Number, Percentage};
use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::generics::transform::TimingFunction as GenericTimingFunction;
use values::generics::transform::TransformOrigin as GenericTransformOrigin;
@ -40,17 +39,6 @@ impl Animatable for TransformOrigin {
}
}
impl ComputeSquaredDistance for TransformOrigin {
#[inline]
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
Ok(
self.horizontal.compute_squared_distance(&other.horizontal)? +
self.vertical.compute_squared_distance(&other.vertical)? +
self.depth.compute_squared_distance(&other.depth)?
)
}
}
impl ToAnimatedZero for TransformOrigin {
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> {