mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Allow long clicks
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user