From 04673c65f4858c0269a7c545c2ea659ff9d0d3e9 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sun, 26 Oct 2014 22:22:08 +0000 Subject: [PATCH] Node drag start threshold incorrectly calculated --- public/red/ui/view.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/red/ui/view.js b/public/red/ui/view.js index 88f78c8bf..275cbe1c2 100644 --- a/public/red/ui/view.js +++ b/public/red/ui/view.js @@ -427,9 +427,12 @@ RED.view = (function() { ); d3.event.preventDefault(); } else if (mouse_mode == RED.state.MOVING) { - mousePos = mouse_position; + mousePos = d3.mouse(document.body); + if (isNaN(mousePos[0])) { + mousePos = d3.touches(document.body)[0]; + } var d = (mouse_offset[0]-mousePos[0])*(mouse_offset[0]-mousePos[0]) + (mouse_offset[1]-mousePos[1])*(mouse_offset[1]-mousePos[1]); - if (d > 2) { + if (d > 3) { mouse_mode = RED.state.MOVING_ACTIVE; clickElapsed = 0; }