set polygons to counter-clockwise
[chise/kage.git] / engine / kagedf.js
index be3cde2..3acbe29 100755 (executable)
@@ -59,7 +59,7 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
       }\r
       break;\r
     case 3:\r
-      if(a3 == 5){\r
+      if(a3 % 1000 == 5){\r
         if(x1 == x2){\r
           if(y1 < y2){ v = 1; } else{ v = -1; }\r
           tx1 = x2;\r
@@ -96,9 +96,9 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
         ty3 = y3;\r
         \r
         cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
-        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1);\r
-        if(tx3 - tx2 > 0){ // for closer position\r
-          cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r
+        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1 + (a3 - a3 % 1000));\r
+        if((x2 < x3 && tx3 - tx2 > 0) || (x2 > x3 && tx2 - tx3 > 0)){ // for closer position\r
+          cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6 + (a3 - a3 % 1000), 5); // bolder by force\r
         }\r
       }\r
       else{\r
@@ -135,8 +135,8 @@ function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){
           ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r
         }\r
         cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r
-        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1);\r
-        cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6, a3); // bolder by force\r
+        cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1 + (a3 - a3 % 1000));\r
+        cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6 + (a3 - a3 % 1000), a3); // bolder by force\r
       }\r
       break;\r
     case 12:\r