mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 00:39:49 +00:00
Allow floating reroutes to be chained when creating new (#828)
- Resolves #827
This commit is contained in:
@@ -636,14 +636,16 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
type_filter_out: firstLink.fromSlot.type,
|
||||
}
|
||||
|
||||
const afterRerouteId = firstLink.fromReroute?.id
|
||||
|
||||
if ("shiftKey" in e && e.shiftKey) {
|
||||
if (this.allow_searchbox) {
|
||||
this.showSearchBox(e as unknown as MouseEvent, linkReleaseContext)
|
||||
}
|
||||
} else if (this.linkConnector.state.connectingTo === "input") {
|
||||
this.showConnectionMenu({ nodeFrom: firstLink.node, slotFrom: firstLink.fromSlot, e })
|
||||
this.showConnectionMenu({ nodeFrom: firstLink.node, slotFrom: firstLink.fromSlot, e, afterRerouteId })
|
||||
} else {
|
||||
this.showConnectionMenu({ nodeTo: firstLink.node, slotTo: firstLink.fromSlot, e })
|
||||
this.showConnectionMenu({ nodeTo: firstLink.node, slotTo: firstLink.fromSlot, e, afterRerouteId })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -5627,7 +5629,7 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
if (!slot) throw new TypeError("Cannot add reroute: slot was null")
|
||||
if (!opts.e) throw new TypeError("Cannot add reroute: CanvasPointerEvent was null")
|
||||
|
||||
const reroute = node.connectFloatingReroute([opts.e.canvasX, opts.e.canvasY], slot)
|
||||
const reroute = node.connectFloatingReroute([opts.e.canvasX, opts.e.canvasY], slot, afterRerouteId)
|
||||
if (!reroute) throw new Error("Failed to create reroute")
|
||||
|
||||
dirty()
|
||||
|
||||
Reference in New Issue
Block a user