Proper circle position in vue mode

This commit is contained in:
Austin Mroz
2025-12-13 14:46:06 -08:00
parent f55395eabd
commit f0a086840c
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import type { SlotLayout } from '@/renderer/core/layout/types'
import type { LGraph } from '@/lib/litegraph/src/LGraph'
import type { NodeId } from '@/lib/litegraph/src/LGraphNode'
import type { RerouteId } from '@/lib/litegraph/src/Reroute'
@@ -72,11 +73,20 @@ export class LinkConnectorAdapter {
beginFromInput(
nodeId: NodeId,
inputIndex: number,
opts?: { moveExisting?: boolean; fromRerouteId?: RerouteId }
opts?: {
moveExisting?: boolean
fromRerouteId?: RerouteId
layout: SlotLayout
}
): void {
const node = this.network.getNodeById(nodeId)
const input = node?.inputs?.[inputIndex]
if (!node || !input) return
if (opts?.layout)
input.pos = [
opts.layout.position.x - node.pos[0],
opts.layout.position.y - node.pos[1]
]
const fromReroute = this.network.getReroute(opts?.fromRerouteId)

View File

@@ -671,7 +671,8 @@ export function useSlotLinkInteraction({
})
} else {
activeAdapter.beginFromInput(localNodeId, index, {
moveExisting: shouldMoveExistingInput
moveExisting: shouldMoveExistingInput,
layout
})
}