From a8304791a1b5ba35a74c1c7bbfebdbe1c422160d Mon Sep 17 00:00:00 2001 From: melMass Date: Sat, 3 Jun 2023 04:51:58 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9A=A1=EF=B8=8F=20poc=20of=20the=20i?= =?UTF-8?q?dea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/lib/litegraph.core.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/web/lib/litegraph.core.js b/web/lib/litegraph.core.js index 95f4a2735..077f1e45e 100644 --- a/web/lib/litegraph.core.js +++ b/web/lib/litegraph.core.js @@ -10811,9 +10811,20 @@ LGraphNode.prototype.executeAction = function(action) var destType = false; if (node_right && node_right.outputs && node_right.outputs[link.target_slot]) destType = node_right.inputs[link.target_slot].type; + if (e.altKey) { + var node = LiteGraph.createNode("Reroute"); + that.graph.add(node, true, {doProcess: false}); + + node_left.connect(link.origin_slot,node, 0) + node_right.disconnectInput( link.target_slot ) + node.connect(0, node_right,link.target_slot ); + + node.pos = [e.canvasX, e.canvasY ]; + node.pos[0] -= node.size[0] * 0.5; + return + } + var options = ["Add Node",null,"Delete",null]; - - var menu = new LiteGraph.ContextMenu(options, { event: e, title: link.data != null ? link.data.constructor.name : null,