From 4ef78fe2f0469836e9bae1c9494fb0e20cfb7c93 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 31 Oct 2026 12:16:14 +0100 Subject: [PATCH] Inline the `AnnotationLayerBuilder.prototype.#initAnnotationLayer` method That method was added in PR 19110, however after PR 20321 it's only invoked once and the code can thus be inlined again. --- web/annotation_layer_builder.js | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) 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;