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

Method findResizeDirection

src/LGraphNode.ts:1703–1711  ·  view source on GitHub ↗

* Returns which resize corner the point is over, if any. * @param canvasX X position in canvas coordinates * @param canvasY Y position in canvas coordinates * @returns The compass corner the point is in, otherwise `undefined`.

(canvasX: number, canvasY: number)

Source from the content-addressed store, hash-verified

1701 * @returns The compass corner the point is in, otherwise `undefined`.
1702 */
1703 findResizeDirection(canvasX: number, canvasY: number): CompassCorners | undefined {
1704 if (this.resizable === false) return
1705
1706 const { boundingRect } = this
1707 if (!boundingRect.containsXy(canvasX, canvasY)) return
1708
1709 // Check corners first (they take priority over edges)
1710 return boundingRect.findContainingCorner(canvasX, canvasY, LGraphNode.resizeHandleSize)
1711 }
1712
1713 /**
1714 * returns all the info available about a property of this node.

Callers 3

#processNodeClickMethod · 0.80
processMouseMoveMethod · 0.80

Calls 2

containsXyMethod · 0.80
findContainingCornerMethod · 0.80

Tested by

no test coverage detected