mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 01:04:06 +00:00
Fix move links & drop on canvas ignores reroutes (#775)
Moving links onto the canvas re-connects existing reroutes after picking a new node.
This commit is contained in:
@@ -511,18 +511,20 @@ export class LinkConnector {
|
||||
|
||||
/** Sets connecting_links, used by some extensions still. */
|
||||
#setLegacyLinks(fromSlotIsInput: boolean): void {
|
||||
const links = this.renderLinks.map<ConnectingLink>((link) => {
|
||||
const links = this.renderLinks.map((link) => {
|
||||
const input = fromSlotIsInput ? link.fromSlot as INodeInputSlot : null
|
||||
const output = fromSlotIsInput ? null : link.fromSlot as INodeOutputSlot
|
||||
|
||||
const afterRerouteId = link instanceof MovingRenderLink ? link.link?.parentId : link.fromReroute?.id
|
||||
|
||||
return {
|
||||
node: link.node,
|
||||
slot: link.fromSlotIndex,
|
||||
input,
|
||||
output,
|
||||
pos: link.fromPos,
|
||||
after: link.fromReroute?.id,
|
||||
}
|
||||
afterRerouteId,
|
||||
} satisfies ConnectingLink
|
||||
})
|
||||
this.#setConnectingLinks(links)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user