aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/properties/helpers/animated_properties.mako.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs
index 1af4268b32d..6b1c9183348 100644
--- a/components/style/properties/helpers/animated_properties.mako.rs
+++ b/components/style/properties/helpers/animated_properties.mako.rs
@@ -2272,9 +2272,11 @@ impl Animatable for MatrixDecomposed3D {
/// https://drafts.csswg.org/css-transforms/#interpolation-of-decomposed-3d-matrix-values
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64)
-> Result<Self, ()> {
- assert!(self_portion + other_portion == 1.0f64 ||
- other_portion == 1.0f64,
- "add_weighted should only be used for interpolating or accumulating transforms");
+ use std::f64;
+
+ debug_assert!((self_portion + other_portion - 1.0f64).abs() <= f64::EPSILON ||
+ other_portion == 1.0f64,
+ "add_weighted should only be used for interpolating or accumulating transforms");
let mut sum = *self;