From 238314e606b0403a6d9a9c1fdc6587a9d6614b7a Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Wed, 13 Jun 2018 06:42:14 +0900 Subject: [PATCH] style: Double f64::EPSILON for calculation error. It's possible that both this_weight and other_weght have calculation errors which are approximately equal to f64::EPSILON. Bug: 1468294 Reviewed-by: birtles MozReview-Commit-ID: 8OddG9rI3qd --- .../style/properties/helpers/animated_properties.mako.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index d935726eb486..de0e48c782d6 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -1739,7 +1739,9 @@ impl Animate for Quaternion { let (this_weight, other_weight) = procedure.weights(); debug_assert!( - (this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON || + // Doule EPSILON since both this_weight and other_weght have calculation errors + // which are approximately equal to EPSILON. + (this_weight + other_weight - 1.0f64).abs() <= f64::EPSILON * 2.0 || other_weight == 1.0f64 || other_weight == 0.0f64, "animate should only be used for interpolating or accumulating transforms" );