mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-15 15:54:38 +08:00
Update jsnodes.js
This commit is contained in:
parent
f2dd09aa12
commit
501c1df1bc
@ -177,14 +177,13 @@ app.registerExtension({
|
|||||||
// 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 (nodes, out) {
|
||||||
const visibleNodes = originalComputeVisibleNodes.apply(this, arguments);
|
const visibleNodesSet = new Set(originalComputeVisibleNodes.apply(this, arguments));
|
||||||
const setAndGetNodes = this.graph._nodes.filter(node => node.type === "SetNode" || node.type === "GetNode");
|
for (const node of this.graph._nodes) {
|
||||||
for (const node of setAndGetNodes) {
|
if ((node.type === "SetNode" || node.type === "GetNode") && node.drawConnection) {
|
||||||
if (!visibleNodes.includes(node) && node.drawConnection) {
|
visibleNodesSet.add(node);
|
||||||
visibleNodes.push(node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return visibleNodes;
|
return Array.from(visibleNodesSet);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user