Merge pull request #16535 from calixteman/restore_freetext

[Editor] Allow to edit FreeText annotations
This commit is contained in:
calixteman 2023-06-15 18:10:41 +02:00 committed by GitHub
commit 5581e22cc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 459 additions and 39 deletions

View file

@ -2629,7 +2629,7 @@ class AnnotationLayer {
#div = null;
#editableAnnotations = new Set();
#editableAnnotations = new Map();
constructor({ div, accessibilityManager, annotationCanvasMap }) {
this.#div = div;
@ -2696,7 +2696,7 @@ class AnnotationLayer {
}
if (element.annotationEditorType > 0) {
this.#editableAnnotations.add(element);
this.#editableAnnotations.set(element.data.id, element);
}
const rendered = element.render();
@ -2767,7 +2767,11 @@ class AnnotationLayer {
}
getEditableAnnotations() {
return this.#editableAnnotations;
return Array.from(this.#editableAnnotations.values());
}
getEditableAnnotation(id) {
return this.#editableAnnotations.get(id);
}
}