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] &&