// but inherits from its parent node which is also parent of
// the shape node. To fix it, specifically concatenating the
// shape node matrix to the masking node matrix.
if (!(node instanceof GroupNode || node instanceof GraphicNode))
{
FXGMatrix nodeMatrix = null;
MatrixNode matrixNodeShape = ((GraphicContentNode)node).matrix;
if (matrixNodeShape == null)
// Convert shape node's discreet transform attributes to
// matrix.
nodeMatrix = FXGMatrix.convertToMatrix(((GraphicContentNode)node).scaleX, ((GraphicContentNode)node).scaleY, ((GraphicContentNode)node).rotation, ((GraphicContentNode)node).x, ((GraphicContentNode)node).y);
else
nodeMatrix = new FXGMatrix(matrixNodeShape);
// Get masking node matrix.
MatrixNode matrixNodeMasking = ((GraphicContentNode)mask).matrix;
// Create a new MatrixNode if the masking node doesn't have one.
if (matrixNodeMasking == null)
{
// Convert masking node's transform attributes to matrix
// so we can concatenate the shape node's matrix to it.
((GraphicContentNode)mask).convertTransformAttrToMatrix();
matrixNodeMasking = ((GraphicContentNode)mask).matrix;
}
FXGMatrix maskMatrix = new FXGMatrix(matrixNodeMasking);
// Concatenate the shape node's matrix to the masking node's
// matrix.
maskMatrix.concat(nodeMatrix);
// Set the masking node's matrix with the concatenated values.
maskMatrix.setMatrixNodeValue(matrixNodeMasking);
}
markLeafNodesAsMask(node, (GroupNode) mask);
po3 = group((GroupNode)mask);
}