diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Layer.js
+++ b/lib/OpenLayers/Layer.js
@@ -508,8 +508,8 @@ OpenLayers.Layer.prototype = {
             var center = this.map.getCenter();
             var res  = this.map.getResolution();
         
-            var delta_x = viewPortPx.x - (size.w / 2);
-            var delta_y = viewPortPx.y - (size.h / 2);
+            var delta_x = viewPortPx.x - Math.ceil(size.w / 2);
+            var delta_y = viewPortPx.y - Math.ceil(size.h / 2);
             
             lonlat = new OpenLayers.LonLat(center.lon + delta_x * res ,
                                          center.lat - delta_y * res);
This is a partial fix to the fact that putting WMS overlays over WMS does not
use the same grid boundaries as the underlying tiles, although not a complete
fix.


git-svn-id: <URL>