From 0ec90b17e89a438add1f2b689ad928ef782e4ae1 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 27 May 2006 13:08:15 +0000 Subject: [PATCH] Commit changes to Anchored popup: add anchor width/height to top left position if we're heading in that direction. I'm still not sure how perfect this is, but it stops the bubbles from being on top of my icons. git-svn-id: http://svn.openlayers.org/trunk/openlayers@421 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup/Anchored.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index 2ee59e9e75..543c3ec413 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -23,13 +23,11 @@ OpenLayers.Popup.Anchored.prototype = * @param {String} contentHTML */ initialize:function(id, lonlat, size, contentHTML, anchorSize) { - var newArguments = new Array(id, lonlat, size, contentHTML); OpenLayers.Popup.prototype.initialize.apply(this, newArguments); this.anchorSize = (anchorSize != null) ? anchorSize : new OpenLayers.Size(0,0); - }, /** @@ -102,14 +100,13 @@ OpenLayers.Popup.Anchored.prototype = * @type OpenLayers.Pixel */ calculateNewPx:function(px) { - var newPx = px.copyOf(); var top = (this.relativePosition.charAt(0) == 't'); - newPx.y += (top) ? -this.size.h : this.anchorSize.h; + newPx.y += (top) ? -(this.size.h + this.anchorSize.h) : this.anchorSize.h; var left = (this.relativePosition.charAt(1) == 'l'); - newPx.x += (left) ? -this.size.w : this.anchorSize.w; + newPx.x += (left) ? -(this.size.w + this.anchorSize.w) : this.anchorSize.w; return newPx; },