1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Fix autolinking error due to redundant annotations on zooming

Fix an issue where redundant links were being added to the annotation
layer on zooming on the page with the links.
This commit is contained in:
Ujjwal Sharma 2025-02-12 01:30:38 +01:00
parent 70e2873430
commit 38ab358fb1
2 changed files with 62 additions and 2 deletions

View file

@ -77,6 +77,8 @@ class AnnotationLayerBuilder {
#eventAbortController = null;
#linksInjected = false;
/**
* @param {AnnotationLayerBuilderOptions} options
*/
@ -235,9 +237,10 @@ class AnnotationLayerBuilder {
"`render` method must be called before `injectLinkAnnotations`."
);
}
if (this._cancelled) {
if (this._cancelled || this.#linksInjected) {
return;
}
this.#linksInjected = true;
const newLinks = this.#annotations.length
? this.#checkInferredLinks(inferredLinks)