Fix way dragging distortion. Fixes #258

This commit is contained in:
Tom MacWright
2012-12-12 17:45:20 -05:00
parent f527a4f6fd
commit dc4c5dcb3f

View File

@@ -19,13 +19,14 @@ iD.modes.Select = function (entity) {
mode.history.perform(iD.actions.Noop());
}
entity.nodes.forEach(function(n) {
var node = mode.history.graph().entity(n.id),
_.uniq(_.pluck(entity.nodes, 'id'))
.forEach(function(id) {
var node = mode.history.graph().entity(id),
start = mode.map.projection(node.loc),
end = mode.map.projection.invert([
start[0] + d3.event.dx,
start[1] + d3.event.dy]);
mode.history.replace(iD.actions.Move(node.id, end));
start[0] + d3.event.dx,
start[1] + d3.event.dy]);
mode.history.replace(iD.actions.Move(id, end));
});
})
.on('dragend', function () {