Merge pull request #4 from sebsofen/fix

fixing problem when adding nodes to existing graph that was loaded from file
This commit is contained in:
Javi Agenjo
2016-11-28 01:18:31 +01:00
committed by GitHub

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;