Fixed function of generating EPS file.
authorKoichi KAMICHI <kamichi@fonts.jp>
Tue, 3 Mar 2009 14:35:18 +0000 (14:35 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Tue, 3 Mar 2009 14:35:18 +0000 (14:35 +0000)
engine/polygons.js

index a52305c..74f2907 100755 (executable)
@@ -74,20 +74,18 @@ function Polygons(){
     buffer += "%%CreationDate: " + new Date() + "\n";\r
     buffer += "%%EndComments\n";\r
     buffer += "%%EndProlog\n";\r
-    buffer += "newpath\n";\r
     \r
     for(var i = 0; i < this.array.length; i++){\r
       for(var j = 0; j < this.array[i].array.length; j++){\r
         buffer += (this.array[i].array[j].x * 5) + " " + (1000 - this.array[i].array[j].y * 5 - 200) + " ";\r
         if(j == 0){\r
-          buffer += "moveto\n";\r
+          buffer += "newpath\nmoveto\n";\r
         } else {\r
           buffer += "lineto\n";\r
         }\r
       }\r
-      buffer += "closepath\n";\r
+      buffer += "closepath\nfill\n";\r
     }\r
-    buffer += "fill\n";\r
     buffer += "%%EOF\n";\r
     return buffer;\r
   }\r