Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add the grey outline when hovering a selected highlight #18879

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/display/editor/annotation_editor_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/display/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,10 @@ class AnnotationEditor {
this.#selectOnPointerEvent(event);
}

get isSelected() {
return this._uiManager.isSelected(this);
}

#selectOnPointerEvent(event) {
const { isMac } = FeatureTest.platform;
if (
Expand All @@ -1123,7 +1127,7 @@ class AnnotationEditor {
}

#setUpDragSession(event) {
const isSelected = this._uiManager.isSelected(this);
const { isSelected } = this;
this._uiManager.setUpDragSession();

const ac = new AbortController();
Expand Down
8 changes: 6 additions & 2 deletions src/display/editor/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down