From 7348e475eb3c7d3ecdf43fc1d8b7b452defbe1cf Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Fri, 20 Sep 2013 16:52:07 +0100 Subject: [PATCH] Fix null mouse_position on node import --- public/red/ui/view.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/red/ui/view.js b/public/red/ui/view.js index 040ffa7af..cddbb4a0a 100644 --- a/public/red/ui/view.js +++ b/public/red/ui/view.js @@ -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];