mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
Fix rebasing and test
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ iD.Tree = function(graph) {
|
||||
|
||||
rebase: function(entities) {
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
if (!graph.hasOwnProperty(entities[i])) {
|
||||
if (!graph.entities.hasOwnProperty(entities[i])) {
|
||||
insert(graph.entity(entities[i]), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ describe("iD.Tree", function() {
|
||||
expect(tree.intersects(iD.geo.Extent([9, 9], [11, 11]), g)).to.eql([node_]);
|
||||
tree.graph().rebase({ 'n': node });
|
||||
tree.rebase(['n']);
|
||||
expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), tree.graph())).to.eql([]);
|
||||
expect(tree.intersects(iD.geo.Extent([0, 0], [2, 2]), g)).to.eql([]);
|
||||
expect(tree.intersects(iD.geo.Extent([0, 0], [11, 11]), g)).to.eql([node_]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user