From 93f9f38b3511379e2148c3ac1cc692ec58c519d0 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 18 May 2006 05:25:09 +0000 Subject: [PATCH] need to make sure a size has been declared before trying to set the offset. thank you automated testing for finding this one. git-svn-id: http://svn.openlayers.org/trunk/openlayers@130 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index dfa11f4555..c6e02a33d1 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -27,7 +27,7 @@ OpenLayers.Icon.prototype = { this.url = url; this.offset = offset; - if (offset == null) { + if ((size != null) && (offset == null)) { // default offset this.offset = new OpenLayers.Pixel(-(size.w / 2), -size.h); }