Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/litegraph/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,9 @@ export class LGraphCanvas implements CustomEventDispatcher<LGraphCanvasEventMap>
}

// get node over
const node = graph.getNodeOnPos(x, y, this.visible_nodes)
const node = LiteGraph.vueNodesMode
? null
: graph.getNodeOnPos(x, y, this.visible_nodes)

Comment on lines +3190 to 3193
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Regression risk: disabling node hit-testing breaks link snapping in Vue mode.

Setting node to null in Vue mode bypasses all slot/hover/link highlight logic in processMouseMove, which matches the reported regression where dragged links only connect when directly over the node. Keep hit-testing, and instead suppress the cursor crosshair by gating the CanvasItem.Node flag. Also prefer undefined over null for litegraph internals.

✅ Suggested fix (preserve hit-testing, suppress cursor)
-    const node = LiteGraph.vueNodesMode
-      ? null
-      : graph.getNodeOnPos(x, y, this.visible_nodes)
+    const node = graph.getNodeOnPos(x, y, this.visible_nodes) ?? undefined
+    const allowNodeHover = !LiteGraph.vueNodesMode
@@
-      if (node) {
-        underPointer |= CanvasItem.Node
+      if (node) {
+        if (allowNodeHover) underPointer |= CanvasItem.Node

As per coding guidelines, prefer returning undefined over null in litegraph code.

🤖 Prompt for AI Agents
In `@src/lib/litegraph/src/LGraphCanvas.ts` around lines 3190 - 3193, The current
change in LGraphCanvas (where node is set to null when LiteGraph.vueNodesMode is
true) disables hit-testing and breaks link-snapping; instead, call
graph.getNodeOnPos(x, y, this.visible_nodes) in all modes (so processMouseMove
still receives a node) but when Vue mode is active suppress the cursor/hover
logic by masking out CanvasItem.Node (i.e., gate the cursor crosshair/hover
checks in processMouseMove by checking LiteGraph.vueNodesMode before using the
CanvasItem.Node flag); return undefined rather than null to follow litegraph
conventions and ensure no other code treats the value as a deliberate null.

const dragRect = this.dragging_rectangle
if (dragRect) {
Expand Down