From c5b493e13e8b66bf14836ba141b2559bf36e0700 Mon Sep 17 00:00:00 2001 From: Jeremiah Saunders Date: Thu, 1 Aug 2024 08:12:14 -0500 Subject: [PATCH 1/2] Bring comment to the block layer when clicked --- core/comments/rendered_workspace_comment.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 79caf6a1d58..7cc6438087c 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -28,6 +28,7 @@ import { import {IContextMenu} from '../interfaces/i_contextmenu.js'; import * as contextMenu from '../contextmenu.js'; import {ContextMenuRegistry} from '../contextmenu_registry.js'; +import * as layers from '../layers.js'; export class RenderedWorkspaceComment extends WorkspaceComment @@ -208,6 +209,7 @@ export class RenderedWorkspaceComment const gesture = this.workspace.getGesture(e); if (gesture) { gesture.handleCommentStart(e, this); + this.workspace.getLayerManager()?.append(this, layers.BLOCK); common.setSelected(this); } } From f074f39f13fdccf32f29ae0196871aeb113281be Mon Sep 17 00:00:00 2001 From: Jeremiah Saunders Date: Thu, 1 Aug 2024 08:15:35 -0500 Subject: [PATCH 2/2] Bring bubbles to front when clicked --- core/bubbles/bubble.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/bubbles/bubble.ts b/core/bubbles/bubble.ts index 35b9e7dde0a..e86f5a85673 100644 --- a/core/bubbles/bubble.ts +++ b/core/bubbles/bubble.ts @@ -212,9 +212,10 @@ export abstract class Bubble implements IBubble, ISelectable { this.background.setAttribute('fill', colour); } - /** Passes the pointer event off to the gesture system. */ + /** Brings the bubble to the front and passes the pointer event off to the gesture system. */ private onMouseDown(e: PointerEvent) { this.workspace.getGesture(e)?.handleBubbleStart(e, this); + this.bringToFront(); common.setSelected(this); }