diff --git a/web/annotation_layer_builder.js b/web/annotation_layer_builder.js index 2ad070a31f546..df787351d5635 100644 --- a/web/annotation_layer_builder.js +++ b/web/annotation_layer_builder.js @@ -162,7 +162,19 @@ class AnnotationLayerBuilder { const div = (this.div = document.createElement("div")); div.className = "annotationLayer"; this.#onAppend?.(div); - this.#initAnnotationLayer(viewport, structTreeLayer); + + this.annotationLayer = new AnnotationLayer({ + div, + accessibilityManager: this._accessibilityManager, + annotationCanvasMap: this._annotationCanvasMap, + annotationEditorUIManager: this._annotationEditorUIManager, + annotationStorage: this.annotationStorage, + page: this.pdfPage, + viewport: viewport.clone({ dontFlip: true }), + structTreeLayer, + commentManager: this.#commentManager, + linkService: this.linkService, + }); if (annotations.length === 0) { this.#annotations = annotations; @@ -207,21 +219,6 @@ class AnnotationLayerBuilder { } } - #initAnnotationLayer(viewport, structTreeLayer) { - this.annotationLayer = new AnnotationLayer({ - div: this.div, - accessibilityManager: this._accessibilityManager, - annotationCanvasMap: this._annotationCanvasMap, - annotationEditorUIManager: this._annotationEditorUIManager, - annotationStorage: this.annotationStorage, - page: this.pdfPage, - viewport: viewport.clone({ dontFlip: true }), - structTreeLayer, - commentManager: this.#commentManager, - linkService: this.linkService, - }); - } - cancel() { this._cancelled = true;