1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 08:38:06 +02:00

Adjust how AnnotationBorderStyle.setWidth handles the input being a Name (issue 10385)

In order to be consistent with the behaviour in Adobe Reader, the width will now always be set to zero when the input is a `Name`.
This commit is contained in:
Jonas Jenwald 2019-01-04 10:33:15 +01:00
parent 5a2bd9fc63
commit 66fccd860b
2 changed files with 9 additions and 5 deletions

View file

@ -485,7 +485,8 @@ class AnnotationBorderStyle {
// Some corrupt PDF generators may provide the width as a `Name`,
// rather than as a number (fixes issue 10385).
if (isName(width)) {
width = parseFloat(width.name);
this.width = 0; // This is consistent with the behaviour in Adobe Reader.
return;
}
if (Number.isInteger(width)) {
this.width = width;