[Editor] Avoid to add a new ink editor when we aren't editing anymore

This commit is contained in:
Calixte Denizet 2023-11-27 15:06:23 +01:00
parent b7e943bc7d
commit 2be136ab70
2 changed files with 7 additions and 5 deletions

View File

@ -152,10 +152,8 @@ class AnnotationEditorLayer {
}
addInkEditorIfNeeded(isCommitting) {
if (
!isCommitting &&
this.#uiManager.getMode() !== AnnotationEditorType.INK
) {
if (this.#uiManager.getMode() !== AnnotationEditorType.INK) {
// We don't want to add an ink editor if we're not in ink mode!
return;
}

View File

@ -1604,7 +1604,11 @@ class AnnotationEditorUIManager {
if (this.#activeEditor) {
// An editor is being edited so just commit it.
this.#activeEditor.commitOrRemove();
return;
if (this.#mode !== AnnotationEditorType.NONE) {
// If the mode is NONE, we want to really unselect the editor, hence we
// mustn't return here.
return;
}
}
if (!this.hasSelection) {