From 7ff13328198b8e677561a2db9b965db8064f2949 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 1 Jun 2006 00:10:06 +0000 Subject: [PATCH] minor change to calculation of center points for bounds. less overhead. git-svn-id: http://svn.openlayers.org/trunk/openlayers@482 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index c2f6e84e42..7b37e3761e 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -339,8 +339,8 @@ OpenLayers.Bounds.prototype = { * @type OpenLayers.Pixel */ getCenterPixel:function() { - return new OpenLayers.Pixel(this.left + (this.getWidth() / 2), - this.bottom + (this.getHeight() / 2)); + return new OpenLayers.Pixel( (this.left + this.right) / 2, + (this.bottom + this.top) / 2); }, /** @@ -348,8 +348,8 @@ OpenLayers.Bounds.prototype = { * @type OpenLayers.LonLat */ getCenterLonLat:function() { - return new OpenLayers.LonLat(this.left + (this.getWidth() / 2), - this.bottom + (this.getHeight() / 2)); + return new OpenLayers.LonLat( (this.left + this.right) / 2, + (this.bottom + this.top) / 2); }, /**