mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Merge pull request #16535 from calixteman/restore_freetext
[Editor] Allow to edit FreeText annotations
This commit is contained in:
commit
5581e22cc7
8 changed files with 459 additions and 39 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue