mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
Fix group deselected on title click (#230)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user