From 61a1f35a70ce6493b4f8921127b478dfe58dc8b5 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 25 Jan 2013 13:25:44 -0500 Subject: [PATCH] Use Graph#update in MoveWay --- js/id/actions/move_way.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/id/actions/move_way.js b/js/id/actions/move_way.js index 09ab8fd50..8301539c4 100644 --- a/js/id/actions/move_way.js +++ b/js/id/actions/move_way.js @@ -1,14 +1,14 @@ iD.actions.MoveWay = function(wayId, delta, projection) { return function(graph) { - var way = graph.entity(wayId); + 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)); + _.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)); + }); }); - - return graph; }; };