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
|
@ -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, ()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue