mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 15:33:50 +00:00
15 lines
453 B
JavaScript
15 lines
453 B
JavaScript
iD.actions.MoveWay = function(wayId, delta, projection) {
|
|
return 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 = iD.actions.MoveNode(id, end)(graph);
|
|
});
|
|
|
|
return graph;
|
|
};
|
|
};
|