Skip to content

Commit 04286bc

Browse files
committed
Fix issue with param.trackTransforms
We can only pop() if we push()
1 parent b2188be commit 04286bc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/item/Item.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,11 +3157,12 @@ var Item = Base.extend(Callback, /** @lends Item# */{
31573157
this._drawCount = this._project._drawCount;
31583158
// Keep calculating the current global matrix, by keeping a history
31593159
// and pushing / popping as we go along.
3160-
var transforms = param.transforms,
3160+
var trackTransforms = param.trackTransforms,
3161+
transforms = param.transforms,
31613162
parentMatrix = transforms[transforms.length - 1],
31623163
globalMatrix = parentMatrix.clone().concatenate(this._matrix);
31633164
// Only keep track of transformation if told so. See Project#draw()
3164-
if (param.trackTransforms)
3165+
if (trackTransforms)
31653166
transforms.push(this._globalMatrix = globalMatrix);
31663167
// If the item has a blendMode or is defining an opacity, draw it on
31673168
// a temporary canvas first and composite the canvas afterwards.
@@ -3220,7 +3221,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
32203221
param.clipItem.draw(ctx, param.extend({ clip: true }));
32213222
this._draw(ctx, param);
32223223
ctx.restore();
3223-
transforms.pop();
3224+
if (trackTransforms)
3225+
transforms.pop();
32243226
if (param.clip)
32253227
ctx.clip();
32263228
// If a temporary canvas was created, composite it onto the main canvas:

0 commit comments

Comments
 (0)