diff --git a/src/item/Item.js b/src/item/Item.js index cbe93a0c..02ece697 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -3160,7 +3160,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{ var transforms = param.transforms, parentMatrix = transforms[transforms.length - 1], globalMatrix = parentMatrix.clone().concatenate(this._matrix); - transforms.push(this._globalMatrix = globalMatrix); + // Only keep track of transformation if told so. See Project#draw() + if (param.trackTransforms) + transforms.push(this._globalMatrix = globalMatrix); // If the item has a blendMode or is defining an opacity, draw it on // a temporary canvas first and composite the canvas afterwards. // Paths with an opacity < 1 that both define a fillColor diff --git a/src/project/Project.js b/src/project/Project.js index 45b55407..eac46372 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -370,7 +370,12 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ offset: new Point(0, 0), // A stack of concatenated matrices, to keep track of the current // global matrix, since Canvas is not able tell us (yet). - transforms: [matrix] + transforms: [matrix], + // Tell the drawing routine that we want to track nested matrices + // in param.transforms, and that we want it to set _globalMatrix + // as used below. Item#rasterize() and Raster#getAverageColor() do + // not need to set this. + trackTransforms: true }); for (var i = 0, l = this.layers.length; i < l; i++) this.layers[i].draw(ctx, param);