Only activate ink editor if none is selected
This commit is contained in:
parent
8d154d7f6a
commit
c44ab94d28
@ -113,7 +113,11 @@ class AnnotationEditorLayer {
|
||||
* @param {MouseEvent} event
|
||||
*/
|
||||
mouseover(event) {
|
||||
if (event.target === this.div && event.buttons === 0) {
|
||||
if (
|
||||
event.target === this.div &&
|
||||
event.buttons === 0 &&
|
||||
!this.#uiManager.hasActive()
|
||||
) {
|
||||
// The div is the target so there is no ink editor, hence we can
|
||||
// create a new one.
|
||||
// event.buttons === 0 is here to avoid adding a new ink editor
|
||||
|
@ -570,6 +570,14 @@ class AnnotationEditorUIManager {
|
||||
return this.#activeEditor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is an active editor.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasActive() {
|
||||
return this.#activeEditor !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current editor mode.
|
||||
* @returns {number}
|
||||
|
Loading…
x
Reference in New Issue
Block a user