Update jsnodes.js

This commit is contained in:
kijai 2024-04-25 20:32:50 +03:00
parent f2dd09aa12
commit 501c1df1bc

View File

@ -177,14 +177,13 @@ app.registerExtension({
// to keep Set/Get node virtual connections visible when offscreen
const originalComputeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
LGraphCanvas.prototype.computeVisibleNodes = function (nodes, out) {
const visibleNodes = originalComputeVisibleNodes.apply(this, arguments);
const setAndGetNodes = this.graph._nodes.filter(node => node.type === "SetNode" || node.type === "GetNode");
for (const node of setAndGetNodes) {
if (!visibleNodes.includes(node) && node.drawConnection) {
visibleNodes.push(node);
const visibleNodesSet = new Set(originalComputeVisibleNodes.apply(this, arguments));
for (const node of this.graph._nodes) {
if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection) {
visibleNodesSet.add(node);
}
}
return visibleNodes;
return Array.from(visibleNodesSet);
};
},
});