[OpenLayers-Commits] r11452 - sandbox/pinch/lib/OpenLayers/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 24 19:20:25 EST 2011


Author: tschaub
Date: 2011-02-24 16:20:25 -0800 (Thu, 24 Feb 2011)
New Revision: 11452

Modified:
   sandbox/pinch/lib/OpenLayers/Control/PinchZoom.js
Log:
Round pixel values for translation.

Modified: sandbox/pinch/lib/OpenLayers/Control/PinchZoom.js
===================================================================
--- sandbox/pinch/lib/OpenLayers/Control/PinchZoom.js	2011-02-25 00:13:03 UTC (rev 11451)
+++ sandbox/pinch/lib/OpenLayers/Control/PinchZoom.js	2011-02-25 00:20:25 UTC (rev 11452)
@@ -133,8 +133,8 @@
         var pinchOrigin = this.pinchOrigin;
         var current = evt.xy;
 
-        var dx = (current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x);
-        var dy = (current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y);
+        var dx = Math.round((current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x));
+        var dy = Math.round((current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y));
         
         var style = this.map.layerContainerDiv.style;
         var transform = "translate(" + dx + "px, " + dy + "px) scale(" + scale + ")";



More information about the Commits mailing list