Skip to content

Commit

Permalink
Consume any pending path before drawing an annotation
Browse files Browse the repository at this point in the history
Fixes #18058.
  • Loading branch information
calixteman committed Sep 10, 2024
1 parent 5b4c2fe commit 518b776
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -2701,9 +2701,12 @@ class CanvasGraphics {
} else {
resetCtxToDefault(this.ctx);

// Consume a potential path before clipping.
this.endPath();

this.ctx.rect(rect[0], rect[1], width, height);
this.ctx.clip();
this.endPath();
this.ctx.beginPath();
}
}

Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue18058.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/15269193/file.pdf
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10474,5 +10474,13 @@
"pageIndex": 0
}
}
},
{
"id": "issue18058",
"file": "pdfs/issue18058.pdf",
"md5": "da8fcdf25c83ecb2d4be315be5affc3c",
"rounds": 1,
"link": true,
"type": "eq"
}
]

0 comments on commit 518b776

Please sign in to comment.