Fix null mouse_position on node import

This commit is contained in:
Nicholas O'Leary 2013-09-20 16:52:07 +01:00
parent b6ba859510
commit 7348e475eb
1 changed files with 5 additions and 1 deletions

View File

@ -857,7 +857,11 @@ RED.view = function() {
var root_node = new_ms[0].n;
var dx = root_node.x;
var dy = root_node.y;
if (mouse_position == null) {
mouse_position = [0,0];
}
for (var i in new_ms) {
new_ms[i].n.selected = true;
new_ms[i].n.x -= dx - mouse_position[0];