diff --git a/src/display/editor/annotation_editor_layer.js b/src/display/editor/annotation_editor_layer.js index 2021b6bbd..1cce51228 100644 --- a/src/display/editor/annotation_editor_layer.js +++ b/src/display/editor/annotation_editor_layer.js @@ -734,14 +734,6 @@ class AnnotationEditorLayer { this.#uiManager.toggleSelected(editor); } - /** - * Check if the editor is selected. - * @param {AnnotationEditor} editor - */ - isSelected(editor) { - return this.#uiManager.isSelected(editor); - } - /** * Unselect an editor. * @param {AnnotationEditor} editor diff --git a/src/display/editor/editor.js b/src/display/editor/editor.js index a76ba95da..e4d3c2152 100644 --- a/src/display/editor/editor.js +++ b/src/display/editor/editor.js @@ -1109,6 +1109,10 @@ class AnnotationEditor { this.#selectOnPointerEvent(event); } + get isSelected() { + return this._uiManager.isSelected(this); + } + #selectOnPointerEvent(event) { const { isMac } = FeatureTest.platform; if ( @@ -1123,7 +1127,7 @@ class AnnotationEditor { } #setUpDragSession(event) { - const isSelected = this._uiManager.isSelected(this); + const { isSelected } = this; this._uiManager.setUpDragSession(); const ac = new AbortController(); diff --git a/src/display/editor/highlight.js b/src/display/editor/highlight.js index f6f603873..a8ef49a8b 100644 --- a/src/display/editor/highlight.js +++ b/src/display/editor/highlight.js @@ -596,11 +596,15 @@ class HighlightEditor extends AnnotationEditor { } pointerover() { - this.parent.drawLayer.addClass(this.#outlineId, "hovered"); + if (!this.isSelected) { + this.parent.drawLayer.addClass(this.#outlineId, "hovered"); + } } pointerleave() { - this.parent.drawLayer.removeClass(this.#outlineId, "hovered"); + if (!this.isSelected) { + this.parent.drawLayer.removeClass(this.#outlineId, "hovered"); + } } #keydown(event) {