1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #16397 from calixteman/issue14565

Make something similar to Acrobat when Underline annotation has no appearance
This commit is contained in:
calixteman 2023-05-08 21:16:49 +02:00 committed by GitHub
commit 8f2d8f62f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 3 deletions

View file

@ -4230,15 +4230,16 @@ class UnderlineAnnotation extends MarkupAnnotation {
: [0, 0, 0];
const strokeAlpha = dict.get("CA");
// The values 0.571 and 1.3 below corresponds to what Acrobat is doing.
this._setDefaultAppearance({
xref,
extra: "[] 0 d 1 w",
extra: "[] 0 d 0.571 w",
strokeColor,
strokeAlpha,
pointsCallback: (buffer, points) => {
buffer.push(
`${points[2].x} ${points[2].y} m`,
`${points[3].x} ${points[3].y} l`,
`${points[2].x} ${points[2].y + 1.3} m`,
`${points[3].x} ${points[3].y + 1.3} l`,
"S"
);
return [points[0].x, points[1].x, points[3].y, points[1].y];