1
1
import { LGraphNodeProperties } from '@/lib/litegraph/src/LGraphNodeProperties'
2
2
import {
3
3
type SlotPositionContext ,
4
+ calculateInputSlotPos ,
4
5
calculateInputSlotPosFromSlot ,
5
- getSlotPosition
6
+ calculateOutputSlotPos
6
7
} from '@/renderer/core/canvas/litegraph/slotCalculations'
7
8
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
8
9
import { LayoutSource } from '@/renderer/core/layout/types'
@@ -3266,7 +3267,7 @@ export class LGraphNode
3266
3267
* @returns Position of the input slot
3267
3268
*/
3268
3269
getInputPos ( slot : number ) : Point {
3269
- return getSlotPosition ( this , slot , true )
3270
+ return calculateInputSlotPos ( this . #getSlotPositionContext ( ) , slot )
3270
3271
}
3271
3272
3272
3273
/**
@@ -3275,9 +3276,6 @@ export class LGraphNode
3275
3276
* @returns Position of the centre of the input slot in graph co-ordinates.
3276
3277
*/
3277
3278
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
3281
3279
return calculateInputSlotPosFromSlot ( this . #getSlotPositionContext( ) , input )
3282
3280
}
3283
3281
@@ -3289,7 +3287,10 @@ export class LGraphNode
3289
3287
* @returns Position of the output slot
3290
3288
*/
3291
3289
getOutputPos ( outputSlotIndex : number ) : Point {
3292
- return getSlotPosition ( this , outputSlotIndex , false )
3290
+ return calculateOutputSlotPos (
3291
+ this . #getSlotPositionContext( ) ,
3292
+ outputSlotIndex
3293
+ )
3293
3294
}
3294
3295
3295
3296
/** @inheritdoc */
0 commit comments