Fix for issue #201, sets default node positions in graph

This commit is contained in:
dethe 2013-04-04 14:06:23 -07:00
Родитель 5cfd1c06af
Коммит d44edd7237
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -143,6 +143,13 @@ function GraphNode(connection, isSource){
if (connection){
this.update(connection, isSource);
}
// FIXME: Get the width and height from the add-on somehow
var width = 1000;
var height = 1000;
// Set defaults for graph
this.x = this.px = (Math.random() - 0.5) * 800 + width/2;
this.y = this.py = (Math.random() - 0.5) * 800 + height/2;
this.weight = 0;
}
GraphNode.prototype.update = function(connection, isSource){
if (!this.name){