From 486be2c6fd342e111869b014005b6fa5cc06347b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 4 Dec 2012 11:27:03 -0500 Subject: [PATCH] Fix area/way dragging --- js/id/renderer/map.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 1a3134e97..e87d512ba 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -55,10 +55,9 @@ iD.Map = function() { d3.event.sourceEvent.stopPropagation(); if (!dragging) { - dragging = true; - only = iD.Util.trueObj([entity.id].concat( - _.pluck(map.history.graph().parents(entity.id), 'id'))); - map.history.perform(iD.actions.noop()); + dragging = iD.Util.trueObj([entity.id].concat( + _.pluck(history.graph().parents(entity.id), 'id'))); + history.perform(iD.actions.noop()); } entity.nodes.forEach(function(node) { @@ -66,15 +65,12 @@ iD.Map = function() { var end = projection.invert([start[0] + d3.event.dx, start[1] + d3.event.dy]); node.lon = end[0]; node.lat = end[1]; - map.history.replace(iD.actions.move(node, end)); + history.replace(iD.actions.move(node, end)); }); - - redraw(only); }) .on('dragend', function () { if (dragging) { - dragging = false; - map.update(); + dragging = undefined; redraw(); } }),