From a97a4e4617da964b521755ce8c0ed280b21b3233 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Sun, 20 Jan 2013 19:05:53 -0500 Subject: [PATCH] Fix redrawing shared vertices --- js/id/graph/graph.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/id/graph/graph.js b/js/id/graph/graph.js index 74caf7ceb..0d533d461 100644 --- a/js/id/graph/graph.js +++ b/js/id/graph/graph.js @@ -136,13 +136,20 @@ iD.Graph.prototype = { entity = this.entities[id]; oldentity = graph.entities[id]; if (entity !== oldentity) { - if (entity && entity.type === 'way') { - result = oldentity ? - result + + if (entity && entity.type === 'way' && + oldentity && oldentity.type === 'way') { + result = result .concat(_.difference(entity.nodes, oldentity.nodes)) .concat(_.difference(oldentity.nodes, entity.nodes)) - : result.concat(entity.nodes); + + } else if (entity && entity.type === 'way') { + result = result.concat(entity.nodes); + + } else if (oldentity && oldentity.type === 'way') { + result = result.concat(oldentity.nodes); } + result.push(id); } }