mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
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
This commit is contained in:
parent
9d679c9b20
commit
238314e606
1 changed files with 3 additions and 1 deletions
|
@ -1739,7 +1739,9 @@ impl Animate for Quaternion {
|
||||||
|
|
||||||
let (this_weight, other_weight) = procedure.weights();
|
let (this_weight, other_weight) = procedure.weights();
|
||||||
debug_assert!(
|
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,
|
other_weight == 1.0f64 || other_weight == 0.0f64,
|
||||||
"animate should only be used for interpolating or accumulating transforms"
|
"animate should only be used for interpolating or accumulating transforms"
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue