Skip to content

Commit 039a7a6

Browse files
committed
Reset path bounding box tracking when starting a new path.
Starting a new path will wipe out any of the current subpaths in the current graphics state, so we should reset the min/maxes. This makes a number of the bounding boxes smaller and reduces the number of composed pixels. For the smask tests in the corpus, the number of composed pixesl goes from 19,872,109 to 19,676,905. The difference is much larger on other PDFs though.
1 parent 6a15973 commit 039a7a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/display/canvas.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,6 +3071,7 @@ class CanvasGraphics {
30713071
}
30723072
this.pendingClip = null;
30733073
}
3074+
this.current.startNewPathAndClipBox(this.current.clipBox);
30743075
ctx.beginPath();
30753076
}
30763077

0 commit comments

Comments
 (0)