From 4a2cb9841de5aa0fa7f20b24e3c11e4917670f27 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 28 Mar 2013 15:03:31 -0400 Subject: [PATCH] fix nudging during move operation --- js/id/modes/move.js | 7 +++++++ js/id/renderer/map.js | 1 + 2 files changed, 8 insertions(+) diff --git a/js/id/modes/move.js b/js/id/modes/move.js index d2089a2ad..b1fd7146f 100644 --- a/js/id/modes/move.js +++ b/js/id/modes/move.js @@ -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() { diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 4651b764e..07fbcf5d2 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -263,6 +263,7 @@ iD.Map = function(context) { t[1] += d[1]; projection.translate(t); zoom.translate(projection.translate()); + dispatch.move(map); return redraw(); };