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:
filtered
2025-03-14 07:56:07 +11:00
committed by GitHub
parent d59cc61a21
commit 36f197b34e

View File

@@ -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)
}