From f43d1b316ba4708778f2f3f4137f5459c92fd505 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 12 Sep 2020 16:15:33 +0200 Subject: [PATCH] Revert "canvas: Properly restore all the remaining items in stateStack in endDrawing" --- src/display/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/canvas.js b/src/display/canvas.js index 6293c75fd..58b65d631 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1009,8 +1009,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { endDrawing: function CanvasGraphics_endDrawing() { // Finishing all opened operations such as SMask group painting. - while (this.stateStack.length || this.current.activeSMask !== null) { - this.restore(); + if (this.current.activeSMask !== null) { + this.endSMaskGroup(); } this.ctx.restore();