Fix vue node slot position calculation (#7877)

## Summary

Fix slot position for Vue nodes using LiteGraph calculation

Fixes #7446

## Changes
- Updated getInput/OutputPos to call getSlotPosition which handles
positions for both LiteGraph & Vue nodes correctly
- Add regression test

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7877-Fix-vue-node-slot-position-calculation-2e16d73d365081219afef0e4ebfb0620)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
pythongosssss
2026-01-14 03:40:21 +00:00
committed by GitHub
parent b1b2fd8a4f
commit ebca0cb1e0
7 changed files with 115 additions and 45 deletions

View File

@@ -1,8 +1,6 @@
import { LGraphNodeProperties } from '@/lib/litegraph/src/LGraphNodeProperties'
import {
calculateInputSlotPos,
calculateInputSlotPosFromSlot,
calculateOutputSlotPos,
getSlotPosition
} from '@/renderer/core/canvas/litegraph/slotCalculations'
import type { SlotPositionContext } from '@/renderer/core/canvas/litegraph/slotCalculations'
@@ -3349,7 +3347,7 @@ export class LGraphNode
* @returns Position of the input slot
*/
getInputPos(slot: number): Point {
return calculateInputSlotPos(this.#getSlotPositionContext(), slot)
return getSlotPosition(this, slot, true)
}
/**
@@ -3369,10 +3367,7 @@ export class LGraphNode
* @returns Position of the output slot
*/
getOutputPos(outputSlotIndex: number): Point {
return calculateOutputSlotPos(
this.#getSlotPositionContext(),
outputSlotIndex
)
return getSlotPosition(this, outputSlotIndex, false)
}
/**