Skip to content
Permalink
Browse files

style: Compare absolute dot-product to 1.0 when interpolating quatern…

…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 990f2c6bb9ec1513df25511505c81d0456d56960
Showing with 1 addition and 1 deletion.
  1. +1 −1 components/style/properties/helpers/animated_properties.mako.rs
@@ -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);
}

0 comments on commit 990f2c6

Please sign in to comment.
You can’t perform that action at this time.