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

[Editor] Don't throw when changing the color of an invisible highlight

This commit is contained in:
Calixte Denizet 2024-01-11 17:20:20 +01:00
parent 903af4ee00
commit b4a7007397
2 changed files with 119 additions and 26 deletions

View file

@ -151,12 +151,12 @@ class HighlightEditor extends AnnotationEditor {
this.addCommands({
cmd: () => {
this.color = color;
this.parent.drawLayer.changeColor(this.#id, color);
this.parent?.drawLayer.changeColor(this.#id, color);
this.#colorPicker?.updateColor(color);
},
undo: () => {
this.color = savedColor;
this.parent.drawLayer.changeColor(this.#id, savedColor);
this.parent?.drawLayer.changeColor(this.#id, savedColor);
this.#colorPicker?.updateColor(savedColor);
},
mustExec: true,