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
This commit is contained in:
euzuro
2006-06-01 00:10:06 +00:00
parent 0c698ad7e0
commit 7ff1332819
+4 -4
View File
@@ -339,8 +339,8 @@ OpenLayers.Bounds.prototype = {
* @type OpenLayers.Pixel * @type OpenLayers.Pixel
*/ */
getCenterPixel:function() { getCenterPixel:function() {
return new OpenLayers.Pixel(this.left + (this.getWidth() / 2), return new OpenLayers.Pixel( (this.left + this.right) / 2,
this.bottom + (this.getHeight() / 2)); (this.bottom + this.top) / 2);
}, },
/** /**
@@ -348,8 +348,8 @@ OpenLayers.Bounds.prototype = {
* @type OpenLayers.LonLat * @type OpenLayers.LonLat
*/ */
getCenterLonLat:function() { getCenterLonLat:function() {
return new OpenLayers.LonLat(this.left + (this.getWidth() / 2), return new OpenLayers.LonLat( (this.left + this.right) / 2,
this.bottom + (this.getHeight() / 2)); (this.bottom + this.top) / 2);
}, },
/** /**