From 4a024651b40e668c2cdcdfefa4c316d1bacaa6a7 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 5 Feb 2013 15:44:50 -0500 Subject: [PATCH] Allow long clicks --- js/id/behavior/draw.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/id/behavior/draw.js b/js/id/behavior/draw.js index b614763b4..e68625d05 100644 --- a/js/id/behavior/draw.js +++ b/js/id/behavior/draw.js @@ -3,6 +3,7 @@ iD.behavior.Draw = function(context) { 'clickNode', 'undo', 'cancel', 'finish'), keybinding = d3.keybinding('draw'), hover = iD.behavior.Hover(), + closeTolerance = 4; tolerance = 12; function datum() { @@ -28,8 +29,9 @@ iD.behavior.Draw = function(context) { d3.select(window).on('mouseup.draw', function() { target.on('mousemove.draw', mousemove); - if (iD.geo.dist(pos, point()) < tolerance && - (+new Date() - time) < 500) { + if (iD.geo.dist(pos, point()) < closeTolerance || + (iD.geo.dist(pos, point()) < tolerance && + (+new Date() - time) < 500)) { click(); } });