Skip to content

Commit

Permalink
Update Litegraph API: Group move / select / titlebar (#1418)
Browse files Browse the repository at this point in the history
* Litegraph: Group move / select

* Update litegraph

---------

Co-authored-by: huchenlei <[email protected]>
  • Loading branch information
webfiltered and huchenlei authored Nov 3, 2024
1 parent 3ba776e commit 56b63eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 49 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/litegraph": "^0.8.17",
"@comfyorg/litegraph": "^0.8.18",
"@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0",
"axios": "^1.7.4",
Expand Down
45 changes: 1 addition & 44 deletions src/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1219,29 +1219,6 @@ export class ComfyApp {
}

const res = origProcessMouseDown.apply(this, arguments)

this.selected_group_moving = false

if (this.selected_group && !this.selected_group_resizing) {
var font_size =
this.selected_group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE
var height = font_size * 1.4

// Move group by header
if (
LiteGraph.isInsideRectangle(
e.canvasX,
e.canvasY,
this.selected_group.pos[0],
this.selected_group.pos[1],
this.selected_group.size[0],
height
)
) {
this.selected_group_moving = true
}
}

return res
}
const origProcessMouseMove = LGraphCanvas.prototype.processMouseMove
Expand Down Expand Up @@ -1269,27 +1246,7 @@ export class ComfyApp {
return
}

const orig_selected_group = this.selected_group

if (
this.selected_group &&
!this.selected_group_resizing &&
!this.selected_group_moving
) {
this.selected_group = null
}

const res = origProcessMouseMove.apply(this, arguments)

if (
orig_selected_group &&
!this.selected_group_resizing &&
!this.selected_group_moving
) {
this.selected_group = orig_selected_group
}

return res
return origProcessMouseMove.apply(this, arguments)
}
}

Expand Down

0 comments on commit 56b63eb

Please sign in to comment.