mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-14 07:06:08 +00:00
Adjust tree for force-rebased entities
Previously, entities that already existed in the rtree prior to the rebase option would end up duplicated in the tree afterward. Fixes #2637
This commit is contained in:
@@ -45,9 +45,17 @@ iD.Tree = function(head) {
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
var entity = entities[i];
|
||||
|
||||
if (!entity.visible || (!force && (head.entities.hasOwnProperty(entity.id) || rectangles[entity.id])))
|
||||
if (!entity.visible)
|
||||
continue;
|
||||
|
||||
if (head.entities.hasOwnProperty(entity.id) || rectangles[entity.id]) {
|
||||
if (!force) {
|
||||
continue;
|
||||
} else if (rectangles[entity.id]) {
|
||||
rtree.remove(rectangles[entity.id]);
|
||||
}
|
||||
}
|
||||
|
||||
insertions[entity.id] = entity;
|
||||
updateParents(entity, insertions, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user