diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 4b734167c7a2..b580e84f9918 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -925,6 +925,13 @@ impl Animatable for Angle { } } } + + #[inline] + fn compute_distance(&self, other: &Self) -> Result { + // Use the formula for calculating the distance between angles defined in SVG: + // https://www.w3.org/TR/SVG/animate.html#complexDistances + Ok((self.radians64() - other.radians64()).abs()) + } } /// https://drafts.csswg.org/css-transitions/#animtype-percentage