From d9a99143af561a6a967c9e21b1ffcefbed830e28 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 2 Apr 2007 00:39:53 +0000 Subject: [PATCH] Resolve #609 with Schuyler looking over my shoulder for review. Instead of always having a calculateOffset (which overwrites offset if it exists), always have an offset. If people want calculateOffset, they can add it. Reported by David Bitner. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2962 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Icon.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 0329690a84..28584930e3 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -40,12 +40,8 @@ OpenLayers.Icon.prototype = { initialize: function(url, size, offset, calculateOffset) { this.url = url; this.size = (size) ? size : new OpenLayers.Size(20,20); - this.offset = offset; - this.calculateOffset = (calculateOffset) ? calculateOffset - : function(size) { - return new OpenLayers.Pixel(-(size.w/2), - -(size.h/2)); - }; + this.offset = offset ? offset : new OpenLayers.Pixel(-(size.w/2), -(size.h/2)); + this.calculateOffset = calculateOffset; var id = OpenLayers.Util.createUniqueID("OL_Icon_"); this.imageDiv = OpenLayers.Util.createAlphaImageDiv(id);