1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

[Editor] Don't make editable an empty freetext annotation

This commit is contained in:
Calixte Denizet 2023-06-21 11:07:14 +02:00
parent 7588418b09
commit 19f7a8b899
3 changed files with 44 additions and 1 deletions

View file

@ -999,6 +999,9 @@ class Annotation {
enqueue(chunk, size) {
for (const item of chunk.items) {
if (item.str === undefined) {
continue;
}
buffer.push(item.str);
if (item.hasEOL) {
text.push(buffer.join(""));
@ -1022,7 +1025,7 @@ class Annotation {
text.push(buffer.join(""));
}
if (text.length > 0) {
if (text.length > 1 || text[0]) {
this.data.textContent = text;
}
}