Skip to content

Commit

Permalink
Merge pull request #18726 from calixteman/issue18058
Browse files Browse the repository at this point in the history
Consume any pending path before drawing an annotation
  • Loading branch information
calixteman authored Sep 10, 2024
2 parents 66ed4b9 + 518b776 commit 0ac7f29
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 0ac7f29

Please sign in to comment.