Skip to content

Commit

Permalink
fixup! Add logic to track rendering area of various PDF ops
Browse files Browse the repository at this point in the history
Use canvas width/height instead of Infinity for unknown
  • Loading branch information
nicolo-ribaudo committed Dec 16, 2024
1 parent e7af90f commit eac70e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,6 @@ class CanvasGraphics {
}

save(opIdx) {
debugger;
CanvasRecorder.startGroupRecording(this.ctx, {
type: "save",
startIdx: opIdx,
Expand All @@ -1666,7 +1665,6 @@ class CanvasGraphics {
}

restore(opIdx) {
debugger;
if (this.stateStack.length === 0 && this.inSMaskMode) {
this.endSMaskMode();
}
Expand Down
5 changes: 2 additions & 3 deletions src/display/canvas_recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export class CanvasRecorder {
}

#endGroup(type) {
debugger;
const group = this.#groupsStack.pop();
if (group.data.type !== type) {
this.#groupsStack.push(group);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit eac70e4

Please sign in to comment.