mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Ignore Square/Circle-annnotations with a zero borderWidth when creating a fallback appearance stream (issue 14164)
Trying to render these Annotation-types, when the borderWidth is `0`, causes a "hairline" border to appear. If these Annotations included an appearance stream, as they are supposed to, this wouldn't have happened and the simplest solution here seem to be to just ignore these particular Annotations.
This commit is contained in:
parent
bbb64369f1
commit
68e6622c57
3 changed files with 19 additions and 0 deletions
|
@ -2648,6 +2648,11 @@ class SquareAnnotation extends MarkupAnnotation {
|
|||
}
|
||||
const fillAlpha = fillColor ? strokeAlpha : null;
|
||||
|
||||
if (this.borderStyle.width === 0 && !fillColor) {
|
||||
// Prevent rendering a "hairline" border (fixes issue14164.pdf).
|
||||
return;
|
||||
}
|
||||
|
||||
this._setDefaultAppearance({
|
||||
xref: parameters.xref,
|
||||
extra: `${this.borderStyle.width} w`,
|
||||
|
@ -2697,6 +2702,11 @@ class CircleAnnotation extends MarkupAnnotation {
|
|||
}
|
||||
const fillAlpha = fillColor ? strokeAlpha : null;
|
||||
|
||||
if (this.borderStyle.width === 0 && !fillColor) {
|
||||
// Prevent rendering a "hairline" border (fixes issue14164.pdf).
|
||||
return;
|
||||
}
|
||||
|
||||
// Circles are approximated by Bézier curves with four segments since
|
||||
// there is no circle primitive in the PDF specification. For the control
|
||||
// points distance, see https://stackoverflow.com/a/27863181.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue