Make something similar to Acrobat when Underline annotation has no appearance
This commit is contained in:
parent
4d3dfe254f
commit
6c0fdc6ec2
@ -4230,15 +4230,16 @@ class UnderlineAnnotation extends MarkupAnnotation {
|
|||||||
: [0, 0, 0];
|
: [0, 0, 0];
|
||||||
const strokeAlpha = dict.get("CA");
|
const strokeAlpha = dict.get("CA");
|
||||||
|
|
||||||
|
// The values 0.571 and 1.3 below corresponds to what Acrobat is doing.
|
||||||
this._setDefaultAppearance({
|
this._setDefaultAppearance({
|
||||||
xref,
|
xref,
|
||||||
extra: "[] 0 d 1 w",
|
extra: "[] 0 d 0.571 w",
|
||||||
strokeColor,
|
strokeColor,
|
||||||
strokeAlpha,
|
strokeAlpha,
|
||||||
pointsCallback: (buffer, points) => {
|
pointsCallback: (buffer, points) => {
|
||||||
buffer.push(
|
buffer.push(
|
||||||
`${points[2].x} ${points[2].y} m`,
|
`${points[2].x} ${points[2].y + 1.3} m`,
|
||||||
`${points[3].x} ${points[3].y} l`,
|
`${points[3].x} ${points[3].y + 1.3} l`,
|
||||||
"S"
|
"S"
|
||||||
);
|
);
|
||||||
return [points[0].x, points[1].x, points[3].y, points[1].y];
|
return [points[0].x, points[1].x, points[3].y, points[1].y];
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -589,3 +589,4 @@
|
|||||||
!issue16278.pdf
|
!issue16278.pdf
|
||||||
!copy_paste_ligatures.pdf
|
!copy_paste_ligatures.pdf
|
||||||
!issue16316.pdf
|
!issue16316.pdf
|
||||||
|
!issue14565.pdf
|
||||||
|
BIN
test/pdfs/issue14565.pdf
Normal file
BIN
test/pdfs/issue14565.pdf
Normal file
Binary file not shown.
@ -7572,5 +7572,13 @@
|
|||||||
"link": true,
|
"link": true,
|
||||||
"forms": true,
|
"forms": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue14565",
|
||||||
|
"file": "pdfs/issue14565.pdf",
|
||||||
|
"md5": "ee0b064d227fe90a4795ff0c4dd0a47c",
|
||||||
|
"rounds": 1,
|
||||||
|
"annotations": true,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user