Skip to content

Commit 768b6e5

Browse files
Align links to slots in subgraphs (#5876)
When vue nodes is enabled, switch to the new getSlotPosition for subgraph nodes as well. This aligns links to slots in subgraphs. Do note, getSlotPosition is actually the new standard, but we fallback to inputNode.getInputPos since it's so core, idea is to switch over fully to getSlotPosition without the vue flag once things are more stable. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5876-Align-links-to-slots-in-subgraphs-27f6d73d365081148b92f312a0af84a0) by [Unito](https://www.unito.io)
1 parent aed6a4e commit 768b6e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/litegraph/src/LGraphCanvas.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5617,7 +5617,9 @@ export class LGraphCanvas
56175617
const { link, inputNode, input } = resolved
56185618
if (!inputNode || !input) continue
56195619

5620-
const endPos = inputNode.getInputPos(link.target_slot)
5620+
const endPos = LiteGraph.vueNodesMode
5621+
? getSlotPosition(inputNode, link.target_slot, true)
5622+
: inputNode.getInputPos(link.target_slot)
56215623

56225624
this.#renderAllLinkSegments(
56235625
ctx,
@@ -5642,7 +5644,9 @@ export class LGraphCanvas
56425644
const { link, outputNode, output } = resolved
56435645
if (!outputNode || !output) continue
56445646

5645-
const startPos = outputNode.getOutputPos(link.origin_slot)
5647+
const startPos = LiteGraph.vueNodesMode
5648+
? getSlotPosition(outputNode, link.origin_slot, false)
5649+
: outputNode.getOutputPos(link.origin_slot)
56465650

56475651
this.#renderAllLinkSegments(
56485652
ctx,

0 commit comments

Comments
 (0)