Fix redrawing shared vertices

This commit is contained in:
Ansis Brammanis
2013-01-20 19:05:53 -05:00
parent 9c68c15c51
commit a97a4e4617
+11 -4
View File
@@ -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);
}
}