mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-28 10:44:12 +00:00
Double click group title to edit (#714)
* Double click group title to edit * Add playwright test * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { LGraphGroup } from '@comfyorg/litegraph'
|
||||
import { app } from '../../scripts/app'
|
||||
import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'
|
||||
|
||||
@@ -77,8 +78,7 @@ app.registerExtension({
|
||||
content: 'Add Group For Selected Nodes',
|
||||
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
|
||||
callback: () => {
|
||||
// @ts-expect-error
|
||||
var group = new LiteGraph.LGraphGroup()
|
||||
const group = new LGraphGroup()
|
||||
addNodesToGroup(group, this.selected_nodes)
|
||||
app.canvas.graph.add(group)
|
||||
this.graph.change()
|
||||
|
||||
@@ -156,13 +156,11 @@ app.registerExtension({
|
||||
if (this.selected_group_resizing) {
|
||||
roundVectorToGrid(this.selected_group.size)
|
||||
} else if (selectedAndMovingGroup) {
|
||||
// @ts-expect-error
|
||||
const [x, y] = roundVectorToGrid([...selectedAndMovingGroup.pos])
|
||||
const f = ctx.fillStyle
|
||||
const s = ctx.strokeStyle
|
||||
ctx.fillStyle = 'rgba(100, 100, 100, 0.33)'
|
||||
ctx.strokeStyle = 'rgba(100, 100, 100, 0.66)'
|
||||
// @ts-expect-error
|
||||
ctx.rect(x, y, ...selectedAndMovingGroup.size)
|
||||
ctx.fill()
|
||||
ctx.stroke()
|
||||
@@ -183,9 +181,7 @@ app.registerExtension({
|
||||
// @ts-expect-error
|
||||
const lastGroup = app.graph._groups[app.graph._groups.length - 1]
|
||||
if (lastGroup) {
|
||||
// @ts-expect-error
|
||||
roundVectorToGrid(lastGroup.pos)
|
||||
// @ts-expect-error
|
||||
roundVectorToGrid(lastGroup.size)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user