allow nodes to be specified when copying (#3)

This commit is contained in:
pythongosssss
2023-11-13 21:15:11 +00:00
committed by comfyanonymous
parent 3a3a51cfcd
commit f71e6f3106

View File

@@ -7132,15 +7132,16 @@ LGraphNode.prototype.executeAction = function(action)
}
};
LGraphCanvas.prototype.copyToClipboard = function() {
LGraphCanvas.prototype.copyToClipboard = function(nodes) {
var clipboard_info = {
nodes: [],
links: []
};
var index = 0;
var selected_nodes_array = [];
for (var i in this.selected_nodes) {
var node = this.selected_nodes[i];
if (!nodes) nodes = this.selected_nodes;
for (var i in nodes) {
var node = nodes[i];
if (node.clonable === false)
continue;
node._relative_id = index;