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
This commit is contained in:
euzuro
2006-05-18 05:25:09 +00:00
parent bb55859445
commit 93f9f38b35

View File

@@ -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);
}