Fix node redraw when escaping from draw mode

This is the case where the Array of changed element IDs
contains an ID for which there is no corresponding entity
in the graph. While `all` will not contain this entity,
the filter should still return true given its id, so that
it will appear in the exit selection and be removed.
This commit is contained in:
John Firebaugh
2012-12-07 19:13:54 -05:00
parent 358b3719de
commit a9ae2d908e
+6 -9
View File
@@ -81,16 +81,13 @@ iD.Map = function() {
} else {
var only = {};
difference.forEach(function (id) {
var entity = graph.fetch(id);
if (entity) {
only[id] = entity;
graph.parentWays(id).forEach(function (entity) {
only[entity.id] = graph.fetch(entity.id);
});
}
only[id] = graph.fetch(id);
graph.parentWays(id).forEach(function (parent) {
only[parent.id] = graph.fetch(parent.id);
});
});
all = _.values(only);
filter = function(d) { return d.accuracy ? only[d.way] : only[d.id]; };
all = _.compact(_.values(only));
filter = function(d) { return d.accuracy ? d.way in only : d.id in only; };
}
if (all.length > 200000) return hideVector();