From afcb1837e79eba5cfd094c40ece264c2278d2c38 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 8 Feb 2013 11:36:25 -0500 Subject: [PATCH] Only do extent build if necessary --- js/id/geo/extent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/id/geo/extent.js b/js/id/geo/extent.js index f50e469c6..4422b5e39 100644 --- a/js/id/geo/extent.js +++ b/js/id/geo/extent.js @@ -15,7 +15,7 @@ iD.geo.Extent.prototype = [[], []]; _.extend(iD.geo.Extent.prototype, { extend: function (obj) { - obj = new iD.geo.Extent(obj); + if (!(obj instanceof iD.geo.Extent)) obj = new iD.geo.Extent(obj); return iD.geo.Extent([Math.min(obj[0][0], this[0][0]), Math.min(obj[0][1], this[0][1])], [Math.max(obj[1][0], this[1][0]), @@ -28,7 +28,7 @@ _.extend(iD.geo.Extent.prototype, { }, intersects: function (obj) { - obj = new iD.geo.Extent(obj); + if (!(obj instanceof iD.geo.Extent)) obj = new iD.geo.Extent(obj); return obj[0][0] <= this[1][0] && obj[0][1] <= this[1][1] && obj[1][0] >= this[0][0] &&