diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index 9dfd2433a..9c053d134 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -2820,7 +2820,7 @@ export class LGraphCanvas { this.visible_nodes ) - if (!node && e.click_time < 300) { + if (!node && e.click_time < 300 && !this.graph.groups.some(x => x.isPointInTitlebar(e.canvasX, e.canvasY))) { this.deselectAllNodes() } diff --git a/src/LGraphGroup.ts b/src/LGraphGroup.ts index 422343dd5..23847e7dc 100644 --- a/src/LGraphGroup.ts +++ b/src/LGraphGroup.ts @@ -3,7 +3,7 @@ import type { LGraph } from "./LGraph" import type { ISerialisedGroup } from "./types/serialisation" import { LiteGraph } from "./litegraph" import { LGraphCanvas } from "./LGraphCanvas" -import { overlapBounding } from "./measure" +import { isInsideRectangle, overlapBounding } from "./measure" import { LGraphNode } from "./LGraphNode" export interface IGraphGroup { @@ -259,6 +259,11 @@ export class LGraphGroup { ] } + isPointInTitlebar(x: number, y: number): boolean { + const b = this._bounding + return isInsideRectangle(x, y, b[0], b[1], b[2], this.titleHeight) + } + isPointInside = LGraphNode.prototype.isPointInside setDirtyCanvas = LGraphNode.prototype.setDirtyCanvas }