From ee2171b6cecb161e1d3dd9e75f8bcd30c0d91978 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Wed, 28 May 2025 17:34:04 +1000 Subject: [PATCH] Fix node resize cursor flicker (#1070) --- src/LGraphCanvas.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index a20284cd0..54113679b 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -1867,11 +1867,12 @@ export class LGraphCanvas { updateMouseOverNodes(node: LGraphNode | null, e: CanvasMouseEvent): void { if (!this.graph) throw new NullGraphError() + const { pointer } = this const nodes = this.graph._nodes for (const otherNode of nodes) { if (otherNode.mouseOver && node != otherNode) { // mouse leave - this.pointer.resizeDirection = undefined + if (!pointer.eDown) pointer.resizeDirection = undefined otherNode.mouseOver = undefined this._highlight_input = undefined this._highlight_pos = undefined @@ -2819,11 +2820,14 @@ export class LGraphCanvas { } // Resize direction - only show resize cursor if not over inputs/outputs/widgets - if (inputId === -1 && outputId === -1 && !overWidget) { - this.pointer.resizeDirection = node.findResizeDirection(e.canvasX, e.canvasY) - } else { - // Clear resize direction when over inputs/outputs/widgets - this.pointer.resizeDirection &&= undefined + const { pointer } = this + if (!pointer.eDown) { + if (inputId === -1 && outputId === -1 && !overWidget) { + pointer.resizeDirection = node.findResizeDirection(e.canvasX, e.canvasY) + } else { + // Clear resize direction when over inputs/outputs/widgets + pointer.resizeDirection &&= undefined + } } } else { // Reroutes @@ -2846,9 +2850,6 @@ export class LGraphCanvas { group.isInResize(e.canvasX, e.canvasY) ) { this.pointer.resizeDirection = "SE" - } else { - // Clear resize direction when not over any resize handle - this.pointer.resizeDirection = undefined } } }