From 0b41ad2cef71f6e885160dfad66a332d052b56d7 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Wed, 9 Aug 2006 23:38:48 +0000 Subject: [PATCH] Check to see if values are NaN in *.equals(). git-svn-id: http://svn.openlayers.org/trunk/openlayers@1178 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Util.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 0e11f86196..6d5f3d0892 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -64,7 +64,8 @@ OpenLayers.Pixel.prototype = { equals:function(px) { var equals = false; if (px != null) { - equals = ((this.x == px.x) && (this.y == px.y)); + equals = ((this.x == px.x && this.y == px.y) || + (isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y)); } return equals; }, @@ -159,7 +160,8 @@ OpenLayers.Size.prototype = { equals:function(sz) { var equals = false; if (sz != null) { - equals = ((this.w == sz.w) && (this.h == sz.h)); + equals = ((this.w == sz.w && this.h == sz.h) || + (isNaN(this.w) && isNaN(this.h) && isNaN(px.w) && isNaN(px.h)); } return equals; }, @@ -251,6 +253,7 @@ OpenLayers.LonLat.prototype = { var equals = false; if (ll != null) { equals = ((this.lon == ll.lon) && (this.lat == ll.lat)); + (isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat)); } return equals; },