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

Handle non-integer Annotation border widths correctly (issue 14203)

The existing code appears to be wrong, since according to the PDF specification the border width of an Annotation only has to be a number and not specifically an integer. Please see:
 - https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=392
 - https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2096210
 - https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G6.1965562
This commit is contained in:
KouWakai 2021-12-24 22:10:19 +09:00
parent 41dab8e7b6
commit 98158b67a3
4 changed files with 17 additions and 4 deletions

View file

@ -922,7 +922,7 @@ class AnnotationBorderStyle {
this.width = 0; // This is consistent with the behaviour in Adobe Reader.
return;
}
if (Number.isInteger(width)) {
if (typeof width === "number") {
if (width > 0) {
const maxWidth = (rect[2] - rect[0]) / 2;
const maxHeight = (rect[3] - rect[1]) / 2;