Decouple the annotationLayer
and annotationEditorLayer
in the viewer
Currently we'll only initialize and render the `annotationEditorLayer` once the regular `annotationLayer` has been rendered. While it obviously makes sense to render the `annotationEditorLayer` *last*, the way that the code is currently written means that if a third-party user disables the `annotationLayer` then the editing-functionality indirectly becomes disabled as well. Given that this seems like a somewhat arbitrary limitation, this patch simply decouples these two layers while still keeping the rendering order consistent.
This commit is contained in:
parent
ded02941f2
commit
8fa8310ec9
@ -853,11 +853,12 @@ class PDFPageView {
|
||||
|
||||
const resultPromise = paintTask.promise.then(
|
||||
() => {
|
||||
return finishPaintTask(null).then(() => {
|
||||
return finishPaintTask(null).then(async () => {
|
||||
this.#renderTextLayer();
|
||||
|
||||
if (this.annotationLayer) {
|
||||
this.#renderAnnotationLayer().then(() => {
|
||||
await this.#renderAnnotationLayer();
|
||||
}
|
||||
if (this.annotationEditorLayerFactory) {
|
||||
this.annotationEditorLayer ||=
|
||||
this.annotationEditorLayerFactory.createAnnotationEditorLayerBuilder(
|
||||
@ -871,8 +872,6 @@ class PDFPageView {
|
||||
this.#renderAnnotationEditorLayer();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
function (reason) {
|
||||
return finishPaintTask(reason);
|
||||
|
Loading…
x
Reference in New Issue
Block a user