From eac70e404f9ee1c3d975afba532105172ac6d454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 9 Dec 2024 19:47:35 +0100 Subject: [PATCH] fixup! Add logic to track rendering area of various PDF ops Use canvas width/height instead of Infinity for unknown --- src/display/canvas.js | 2 -- src/display/canvas_recorder.js | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/display/canvas.js b/src/display/canvas.js index 8e7419466f3b9..21f709d708b83 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1642,7 +1642,6 @@ class CanvasGraphics { } save(opIdx) { - debugger; CanvasRecorder.startGroupRecording(this.ctx, { type: "save", startIdx: opIdx, @@ -1666,7 +1665,6 @@ class CanvasGraphics { } restore(opIdx) { - debugger; if (this.stateStack.length === 0 && this.inSMaskMode) { this.endSMaskMode(); } diff --git a/src/display/canvas_recorder.js b/src/display/canvas_recorder.js index 47f5d716b17ff..3412dd53d83a4 100644 --- a/src/display/canvas_recorder.js +++ b/src/display/canvas_recorder.js @@ -115,7 +115,6 @@ export class CanvasRecorder { } #endGroup(type) { - debugger; const group = this.#groupsStack.pop(); if (group.data.type !== type) { this.#groupsStack.push(group); @@ -150,9 +149,9 @@ export class CanvasRecorder { #unknown() { this.#currentGroup.minX = 0; - this.#currentGroup.maxX = Infinity; + this.#currentGroup.maxX = this.#canvasWidth; this.#currentGroup.minY = 0; - this.#currentGroup.maxY = Infinity; + this.#currentGroup.maxY = this.#canvasHeight; } #registerBox(minX, maxX, minY, maxY) {