From 5d67a48cfac0bdfd6e41145b0aa453fa375abc87 Mon Sep 17 00:00:00 2001 From: Shaun Johnston Date: Mon, 22 Dec 2025 16:55:54 +1000 Subject: [PATCH] fix js pipe sync --- js/friendly_pipe.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/friendly_pipe.js b/js/friendly_pipe.js index c7e1dab..978fd95 100644 --- a/js/friendly_pipe.js +++ b/js/friendly_pipe.js @@ -54,6 +54,7 @@ function setupFriendlyPipeIn(nodeType, nodeData, app) { // Add name widget for the new slot node.addSlotNameWidget(node.slotCount); node.updateSize(); + node.notifyConnectedOutputs(); node.setDirtyCanvas(true, true); } }); @@ -70,6 +71,7 @@ function setupFriendlyPipeIn(nodeType, nodeData, app) { delete node.slotNames[node.slotCount]; node.slotCount--; node.updateSize(); + node.notifyConnectedOutputs(); node.setDirtyCanvas(true, true); } }); @@ -92,6 +94,7 @@ function setupFriendlyPipeIn(nodeType, nodeData, app) { if (node.inputs && node.inputs[inputIndex]) { node.inputs[inputIndex].label = value; } + node.notifyConnectedOutputs(); node.setDirtyCanvas(true, true); }); nameWidget.slotNum = slotNum; @@ -106,6 +109,21 @@ function setupFriendlyPipeIn(nodeType, nodeData, app) { } }; + nodeType.prototype.notifyConnectedOutputs = function() { + // Find all nodes connected to our output and notify them + if (!this.outputs || !this.outputs[0] || !this.outputs[0].links) return; + + for (const linkId of this.outputs[0].links) { + const link = app.graph.links[linkId]; + if (!link) continue; + + const targetNode = app.graph.getNodeById(link.target_id); + if (targetNode && targetNode.syncWithSource) { + targetNode.syncWithSource(); + } + } + }; + nodeType.prototype.updateSize = function() { this.setSize(this.computeSize()); };