[Mapbender-commits] r1283 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Apr 27 11:13:59 EDT 2007


Author: christoph
Date: 2007-04-27 11:13:59 -0400 (Fri, 27 Apr 2007)
New Revision: 1283

Modified:
   trunk/mapbender/http/javascripts/point.js
Log:
added parseFloat to the constructor

Modified: trunk/mapbender/http/javascripts/point.js
===================================================================
--- trunk/mapbender/http/javascripts/point.js	2007-04-27 15:13:02 UTC (rev 1282)
+++ trunk/mapbender/http/javascripts/point.js	2007-04-27 15:13:59 UTC (rev 1283)
@@ -5,8 +5,8 @@
 */
 //http://www.mapbender.org/index.php/point.js
 function Point(x, y){
-	this.x = x;
-	this.y = y;
+	this.x = parseFloat(x);
+	this.y = parseFloat(y);
 }
 
 Point.prototype.dist = function(p){
@@ -20,7 +20,7 @@
 	return new Point(this.x-p.x, this.y-p.y);
 }
 Point.prototype.plus = function(p){
-	return new Point(parseFloat(this.x)+parseFloat(p.x), parseFloat(this.y)+parseFloat(p.y));
+	return new Point(this.x+p.x, this.y+p.y);
 }
 Point.prototype.dividedBy = function(c){
 	if (c != 0) {return new Point(this.x/c, this.y/c);}



More information about the Mapbender_commits mailing list