Allow long clicks

This commit is contained in:
Tom MacWright
2013-02-05 15:44:50 -05:00
parent 9743fdf477
commit 4a024651b4

View File

@@ -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();
}
});