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

@ -84,7 +84,7 @@ macro_rules! define_keyword_type {
($name: ident, $css: expr) => {
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Copy, PartialEq, ToCss)]
#[derive(Clone, ComputeSquaredDistance, Copy, PartialEq, ToCss)]
pub struct $name;
impl $crate::properties::animated_properties::Animatable for $name {
@ -117,15 +117,5 @@ macro_rules! define_keyword_type {
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> { Ok($name) }
}
impl $crate::values::distance::ComputeSquaredDistance for $name {
#[inline]
fn compute_squared_distance(
&self,
_other: &Self
) -> Result<$crate::values::distance::SquaredDistance, ()> {
Ok($crate::values::distance::SquaredDistance::Value(0.))
}
}
};
}