Extract and fix extent/intersection calculations

Extents are now [[min x, min y], [max x, max y]].
This commit is contained in:
John Firebaugh
2013-01-17 13:44:30 -08:00
parent 6594699276
commit 5a2444b551
17 changed files with 180 additions and 40 deletions
+2 -2
View File
@@ -29,11 +29,11 @@ describe('iD.Node', function () {
describe("#intersects", function () {
it("returns true for a node within the given extent", function () {
expect(iD.Node({loc: [0, 0]}).intersects([[-180, 90], [180, -90]])).to.equal(true);
expect(iD.Node({loc: [0, 0]}).intersects([[-5, -5], [5, 5]])).to.equal(true);
});
it("returns false for a node outside the given extend", function () {
expect(iD.Node({loc: [0, 0]}).intersects([[100, 90], [180, -90]])).to.equal(false);
expect(iD.Node({loc: [6, 6]}).intersects([[-5, -5], [5, 5]])).to.equal(false);
});
});