mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
those who know
This commit is contained in:
@@ -47,11 +47,8 @@ export class MovingInputLink extends MovingLinkBase {
|
|||||||
return this.node.canConnectTo(inputNode, input, this.outputSlot)
|
return this.node.canConnectTo(inputNode, input, this.outputSlot)
|
||||||
}
|
}
|
||||||
|
|
||||||
canConnectToOutput(
|
canConnectToOutput(): boolean {
|
||||||
outputNode: NodeLike,
|
return false
|
||||||
output: INodeOutputSlot | SubgraphIO
|
|
||||||
): boolean {
|
|
||||||
return outputNode.canConnectTo(this.inputNode, this.inputSlot, output)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
canConnectToReroute(reroute: Reroute): boolean {
|
canConnectToReroute(reroute: Reroute): boolean {
|
||||||
@@ -148,34 +145,8 @@ export class MovingInputLink extends MovingLinkBase {
|
|||||||
if (newLink) events.dispatch('input-moved', this)
|
if (newLink) events.dispatch('input-moved', this)
|
||||||
}
|
}
|
||||||
|
|
||||||
connectToRerouteOutput(
|
connectToRerouteOutput(): never {
|
||||||
reroute: Reroute,
|
throw new Error('MovingInputLink cannot connect to an output.')
|
||||||
outputNode: LGraphNode,
|
|
||||||
output: INodeOutputSlot,
|
|
||||||
events: CustomEventTarget<LinkConnectorEventMap>
|
|
||||||
): void {
|
|
||||||
const { inputNode, inputSlot, fromReroute } = this
|
|
||||||
|
|
||||||
this.inputNode.disconnectInput(this.inputIndex, true)
|
|
||||||
|
|
||||||
const floatingTerminus = reroute?.floating?.slotType === 'output'
|
|
||||||
|
|
||||||
if (fromReroute) {
|
|
||||||
fromReroute.parentId = reroute.id
|
|
||||||
} else {
|
|
||||||
this.link.parentId = reroute.id
|
|
||||||
}
|
|
||||||
|
|
||||||
const newLink = outputNode.connectSlots(
|
|
||||||
output,
|
|
||||||
inputNode,
|
|
||||||
inputSlot,
|
|
||||||
this.link.parentId
|
|
||||||
)
|
|
||||||
|
|
||||||
if (floatingTerminus) reroute.removeAllFloatingLinks()
|
|
||||||
|
|
||||||
if (newLink) events.dispatch('input-moved', this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect(): boolean {
|
disconnect(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user