Skip to content

Commit

Permalink
style: Compare absolute dot-product to 1.0 when interpolating quatern…
Browse files Browse the repository at this point in the history
…ions.

See the extended commit message for the following spec change:

  w3c/csswg-drafts@6b36d41

Basically, by failing to take the absolute value, for certain content we can end
up doing division by zero which will mean that the test included in this patch
will cause an assertion to fail in debug builds and return
"matrix(NaN, NaN....)" in release builds.

Differential Revision: https://phabricator.services.mozilla.com/D9618
  • Loading branch information
birtles authored and emilio committed Oct 28, 2018
1 parent ac873c7 commit 990f2c6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -1829,7 +1829,7 @@ impl Animate for Quaternion {
self.3 * other.3)
.min(1.0).max(-1.0);

if dot == 1.0 {
if dot.abs() == 1.0 {
return Ok(*self);
}

Expand Down

0 comments on commit 990f2c6

Please sign in to comment.