Files
iD/js/id/actions/move_way.js
John Firebaugh c981fe5d80 Revert "Wrap all actions in Graph#update"
This reverts commit 3105923371.

See #508.
2013-01-25 16:17:26 -05:00

15 lines
509 B
JavaScript

iD.actions.MoveWay = function(wayId, delta, projection) {
return function(graph) {
return graph.update(function (graph) {
var way = graph.entity(wayId);
_.uniq(way.nodes).forEach(function (id) {
var node = graph.entity(id),
start = projection(node.loc),
end = projection.invert([start[0] + delta[0], start[1] + delta[1]]);
graph = graph.replace(node.move(end));
});
});
};
};