mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
servo: Merge #17656 - Consider f64 epsilon for add_weighted portions (from hiikezoe:fix-assertion-in-add-weighted); r=birtles
This patch also degrade assert! to debug_assert! since crash reports don't show us useful information so far (no assertion messages at all). <!-- Please describe your changes on the following line: --> https://bugzilla.mozilla.org/show_bug.cgi?id=1379757 --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 2475039e40ec898e377c433836edafa5637d63ae --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 970570301f5b6c08fbf3af33533eaad60c440c8a
This commit is contained in:
parent
7bed4f1a85
commit
894367bb6a
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user