fixing problem when adding nodes to existing graph that was loaded from file

This commit is contained in:
sebastian
2016-11-26 09:52:02 +01:00
parent e287521410
commit 1a293a6545

View File

@@ -685,7 +685,9 @@ LGraph.prototype.add = function(node, skip_compute_order)
//give him an id
if(node.id == null || node.id == -1)
node.id = this.last_node_id++;
node.id = ++this.last_node_id;
else if (this.last_node_id < node.id)
this.last_node_id = node.id;
node.graph = this;