Bug 1391014 - take in account the ancestor's transformation too for the current matrix; r=gl

MozReview-Commit-ID: Dc4DU3wPzU8

--HG--
extra : rebase_source : ba22fb39f0415a565167f2da21970acc4e78cdbc
This commit is contained in:
ZER0 2017-09-08 17:18:21 +02:00
parent a33ac3ffff
commit 95da87767f

View File

@ -120,7 +120,7 @@ exports.isIdentity = isIdentity;
/**
* Returns the transformation matrix for the given node, relative to the ancestor passed
* as second argument.
* as second argument; considering the ancestor transformation too.
* If no ancestor is specified, it will returns the transformation matrix relative to the
* node's parent element.
*
@ -132,7 +132,8 @@ exports.isIdentity = isIdentity;
* The transformation matrix.
*/
function getNodeTransformationMatrix(node, ancestor = node.parentElement) {
let { a, b, c, d, e, f } = node.getTransformToAncestor(ancestor);
let { a, b, c, d, e, f } = ancestor.getTransformToParent()
.multiply(node.getTransformToAncestor(ancestor));
return [
a, c, e,