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:
parent
5a2bd9fc63
commit
66fccd860b
2 changed files with 9 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue