Skip to content

Commit

Permalink
Allow nodes to be specified when copying
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lewis committed Jul 1, 2024
1 parent 30a4fbe commit 09dc086
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/litegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -7234,15 +7234,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;
Expand Down

0 comments on commit 09dc086

Please sign in to comment.