MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / getSlotOnPos

Method getSlotOnPos

src/LGraphNode.ts:1995–1999  ·  view source on GitHub ↗

* Returns the input or output slot at the given position. * * Tries getNodeInputOnPos first, then getNodeOutputOnPos. * @param pos The graph co-ordinates to check * @returns The input or output slot at the given position if found, otherwise `undefined`.

(pos: Point)

Source from the content-addressed store, hash-verified

1993 * @returns The input or output slot at the given position if found, otherwise `undefined`.
1994 */
1995 getSlotOnPos(pos: Point): INodeInputSlot | INodeOutputSlot | undefined {
1996 if (!isPointInRect(pos, this.boundingRect)) return
1997
1998 return this.getInputOnPos(pos) ?? this.getOutputOnPos(pos)
1999 }
2000
2001 /**
2002 * @deprecated Use {@link getSlotOnPos} instead.

Callers 1

LGraphNode.test.tsFile · 0.80

Calls 3

getInputOnPosMethod · 0.95
getOutputOnPosMethod · 0.95
isPointInRectFunction · 0.90

Tested by

no test coverage detected