[Mapbender-commits] r6893 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Sep 3 10:54:24 EDT 2010
Author: christoph
Date: 2010-09-03 14:54:24 +0000 (Fri, 03 Sep 2010)
New Revision: 6893
Modified:
trunk/mapbender/http/javascripts/map_obj.js
Log:
fix rounding error
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2010-09-03 14:53:46 UTC (rev 6892)
+++ trunk/mapbender/http/javascripts/map_obj.js 2010-09-03 14:54:24 UTC (rev 6893)
@@ -731,13 +731,8 @@
var posY = parseFloat(maxY - (aPoint.y / this.getHeight()) * xtenty);
posX = Math.round(posX * roundX) / roundX;
posY = Math.round(posY * roundY) / roundY;
- var newX = posX, newY = posY;
- if (digitsX < 0) {
- newX = posX.toFixed(-digitsX);
- }
- if (digitsY < 0) {
- newY = posY.toFixed(-digitsY);
- }
+ newX = posX.toFixed(Math.abs(digitsX));
+ newY = posY.toFixed(Math.abs(digitsY));
var pt = new Point(newX, newY);
return pt;
More information about the Mapbender_commits
mailing list