fix nudging during move operation

This commit is contained in:
Ansis Brammanis
2013-03-28 15:03:31 -04:00
parent 0e1c3d0a0f
commit 4a2cb9841d
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -30,6 +30,11 @@ iD.modes.Move = function(context, entityIDs) {
if (nudgeInterval) window.clearInterval(nudgeInterval);
nudgeInterval = window.setInterval(function() {
context.pan(nudge);
context.replace(
iD.actions.Move(entityIDs, [-nudge[0], -nudge[1]], context.projection),
annotation);
var c = context.projection(origin);
origin = context.projection.invert([c[0] - nudge[0], c[1] - nudge[1]]);
}, 50);
}
@@ -64,11 +69,13 @@ iD.modes.Move = function(context, entityIDs) {
function finish() {
d3.event.stopPropagation();
context.enter(iD.modes.Select(context, entityIDs));
stopNudge();
}
function cancel() {
context.pop();
context.enter(iD.modes.Select(context, entityIDs));
stopNudge();
}
function undone() {
+1
View File
@@ -263,6 +263,7 @@ iD.Map = function(context) {
t[1] += d[1];
projection.translate(t);
zoom.translate(projection.translate());
dispatch.move(map);
return redraw();
};