Skip to content

Commit 027e06d

Browse files
committed
Revert my incredibly intelligent changes
1 parent da87470 commit 027e06d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/lib/litegraph/src/LGraphNode.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { LGraphNodeProperties } from '@/lib/litegraph/src/LGraphNodeProperties'
22
import {
33
type SlotPositionContext,
4+
calculateInputSlotPos,
45
calculateInputSlotPosFromSlot,
5-
getSlotPosition
6+
calculateOutputSlotPos
67
} from '@/renderer/core/canvas/litegraph/slotCalculations'
78
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
89
import { LayoutSource } from '@/renderer/core/layout/types'
@@ -3266,7 +3267,7 @@ export class LGraphNode
32663267
* @returns Position of the input slot
32673268
*/
32683269
getInputPos(slot: number): Point {
3269-
return getSlotPosition(this, slot, true)
3270+
return calculateInputSlotPos(this.#getSlotPositionContext(), slot)
32703271
}
32713272

32723273
/**
@@ -3275,9 +3276,6 @@ export class LGraphNode
32753276
* @returns Position of the centre of the input slot in graph co-ordinates.
32763277
*/
32773278
getInputSlotPos(input: INodeInputSlot): Point {
3278-
const idx = this.inputs.indexOf(input)
3279-
if (idx !== -1) return getSlotPosition(this, idx, true)
3280-
// Fallback when slot instance is not found in inputs
32813279
return calculateInputSlotPosFromSlot(this.#getSlotPositionContext(), input)
32823280
}
32833281

@@ -3289,7 +3287,10 @@ export class LGraphNode
32893287
* @returns Position of the output slot
32903288
*/
32913289
getOutputPos(outputSlotIndex: number): Point {
3292-
return getSlotPosition(this, outputSlotIndex, false)
3290+
return calculateOutputSlotPos(
3291+
this.#getSlotPositionContext(),
3292+
outputSlotIndex
3293+
)
32933294
}
32943295

32953296
/** @inheritdoc */

0 commit comments

Comments
 (0)