mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Derive ComputeSquaredDistance
This commit is contained in:
parent
51b740033b
commit
277351da35
22 changed files with 162 additions and 391 deletions
|
@ -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.))
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue