Correct the default value for isRenderable
in the AnnotationElement
constructor, to fix breaking errors when rendering unsupported annotations
*This regressed in PR 8828.* When attempting to open e.g. http://mirrors.ctan.org/macros/latex/contrib/pdfcomment/doc/example.pdf, the annotation layers are now missing since `Error: Abstract method `AnnotationElement.render` called` is thrown multiple times.
This commit is contained in:
parent
a4cc85fc5f
commit
87fc9bafea
@ -95,7 +95,7 @@ class AnnotationElementFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AnnotationElement {
|
class AnnotationElement {
|
||||||
constructor(parameters, isRenderable = true, ignoreBorder = false) {
|
constructor(parameters, isRenderable = false, ignoreBorder = false) {
|
||||||
this.isRenderable = isRenderable;
|
this.isRenderable = isRenderable;
|
||||||
this.data = parameters.data;
|
this.data = parameters.data;
|
||||||
this.layer = parameters.layer;
|
this.layer = parameters.layer;
|
||||||
@ -250,6 +250,10 @@ class AnnotationElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LinkAnnotationElement extends AnnotationElement {
|
class LinkAnnotationElement extends AnnotationElement {
|
||||||
|
constructor(parameters) {
|
||||||
|
super(parameters, /* isRenderable = */ true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the link annotation's HTML element in the empty container.
|
* Render the link annotation's HTML element in the empty container.
|
||||||
*
|
*
|
||||||
@ -902,7 +906,7 @@ class StrikeOutAnnotationElement extends AnnotationElement {
|
|||||||
|
|
||||||
class FileAttachmentAnnotationElement extends AnnotationElement {
|
class FileAttachmentAnnotationElement extends AnnotationElement {
|
||||||
constructor(parameters) {
|
constructor(parameters) {
|
||||||
super(parameters, true);
|
super(parameters, /* isRenderable = */ true);
|
||||||
|
|
||||||
let file = this.data.file;
|
let file = this.data.file;
|
||||||
this.filename = getFilenameFromUrl(file.filename);
|
this.filename = getFilenameFromUrl(file.filename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user