1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Node drag start threshold incorrectly calculated

This commit is contained in:
Nick O'Leary 2014-10-26 22:22:08 +00:00
parent 57ae297efd
commit 04673c65f4

View File

@ -427,9 +427,12 @@ RED.view = (function() {
); );
d3.event.preventDefault(); d3.event.preventDefault();
} else if (mouse_mode == RED.state.MOVING) { } 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]); 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; mouse_mode = RED.state.MOVING_ACTIVE;
clickElapsed = 0; clickElapsed = 0;
} }