From f1a5faedef04b210caa3e854b1516d94f85cffe4 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Fri, 4 Apr 2008 15:11:24 +0000 Subject: [PATCH] Changed SVG format. Changed from int. to double of points. --- engine/polygon.js | 10 ++++++---- engine/polygons.js | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/polygon.js b/engine/polygon.js index c2e3907..e89ea72 100755 --- a/engine/polygon.js +++ b/engine/polygon.js @@ -1,16 +1,18 @@ function Polygon(number){ + // resolution : 0.1 + // method function push(x, y){ // void var temp = new Object(); - temp.x = Math.floor(x); - temp.y = Math.floor(y); + temp.x = Math.floor(x*10)/10; + temp.y = Math.floor(y*10)/10; this.array.push(temp); } Polygon.prototype.push = push; function set(index, x, y){ // void - this.array[index].x = Math.floor(x); - this.array[index].y = Math.floor(y); + this.array[index].x = Math.floor(x*10)/10; + this.array[index].y = Math.floor(y*10)/10; } Polygon.prototype.set = set; diff --git a/engine/polygons.js b/engine/polygons.js index 74e98dd..6e95331 100755 --- a/engine/polygons.js +++ b/engine/polygons.js @@ -40,8 +40,7 @@ function Polygons(){ function generateSVG(){ // string var buffer = ""; - buffer += "\n\n"; - buffer += "\n"; + buffer += "\n"; buffer += "\n"; for(var i = 0; i < this.array.length; i++){ buffer += "