Skip to content

Commit

Permalink
canvas: restore() should reflect that smask groups are finished when …
Browse files Browse the repository at this point in the history
…stateStack is empty.

This fixes #12367. When we end the SMask group and stateStack.length is zero,
nothing updates this.current to reflect it.
  • Loading branch information
emilio committed Sep 12, 2020
1 parent cdac6f4 commit 6bd6b8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
groupCtx.clearRect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height);
groupCtx.restore();
},
resumeSMaskGroup: function CanvasGraphics_endSMaskGroup() {
resumeSMaskGroup: function CanvasGraphics_resumeSMaskGroup() {
// Resuming state saved by suspendSMaskGroup. We don't need to restore
// any groupCtx state since restore() command (the only caller) will do
// that for us. See also beginSMaskGroup.
Expand Down Expand Up @@ -1254,6 +1254,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.pendingClip = null;

this._cachedGetSinglePixelWidth = null;
} else {
// We've finished all the SMask groups, reflect that in our state.
this.current.activeSMask = null;
}
},
transform: function CanvasGraphics_transform(a, b, c, d, e, f) {
Expand Down

0 comments on commit 6bd6b8f

Please sign in to comment.