mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 22:37:32 +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:
@@ -2330,6 +2330,14 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
|
||||
return null
|
||||
}
|
||||
|
||||
canConnectTo(
|
||||
node: LGraphNode,
|
||||
toSlot: INodeInputSlot,
|
||||
fromSlot: INodeOutputSlot,
|
||||
) {
|
||||
return this.id !== node.id && LiteGraph.isValidConnection(fromSlot.type, toSlot.type)
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect an output of this node to an input of another node
|
||||
* @param slot (could be the number of the slot or the string with the name of the slot)
|
||||
|
||||
Reference in New Issue
Block a user