mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-11 10:30:10 +00:00
Fix moving existing links can result in loopback (#838)
Prevents nodes connecting links to themselves when moving existing links. If moving multiple links with reroutes, this will instead _reconnect_ any links that would become loopbacks, only without any rereoutes.
This commit is contained in:
@@ -2597,8 +2597,8 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
let highlightPos: Point | undefined
|
||||
let highlightInput: INodeInputSlot | undefined
|
||||
|
||||
if (!firstLink || firstLink.node === node) {
|
||||
// No link / node loopback
|
||||
if (!firstLink || !linkConnector.isNodeValidDrop(node)) {
|
||||
// No link, or none of the dragged links may be dropped here
|
||||
} else if (linkConnector.state.connectingTo === "input") {
|
||||
if (inputId === -1 && outputId === -1) {
|
||||
// Allow support for linking to widgets, handled externally to LiteGraph
|
||||
|
||||
Reference in New Issue
Block a user