Update jsnodes.js

This commit is contained in:
kijai 2024-04-25 22:48:50 +03:00
parent 501c1df1bc
commit 0920c127be

View File

@ -174,9 +174,12 @@ app.registerExtension({
break; break;
} }
},
async setup() {
// to keep Set/Get node virtual connections visible when offscreen // to keep Set/Get node virtual connections visible when offscreen
const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes; const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
LGraphCanvas.prototype.computeVisibleNodes = function (nodes, out) { LGraphCanvas.prototype.computeVisibleNodes = function () {
const visibleNodesSet = new Set(originalComputeVisibleNodes.apply(this, arguments)); const visibleNodesSet = new Set(originalComputeVisibleNodes.apply(this, arguments));
for (const node of this.graph._nodes) { for (const node of this.graph._nodes) {
if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection) { if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection) {
@ -185,5 +188,6 @@ app.registerExtension({
} }
return Array.from(visibleNodesSet); return Array.from(visibleNodesSet);
}; };
},
}
}); });