Fixed some mistakes.
authorKoichi KAMICHI <kamichi@fonts.jp>
Wed, 30 Jul 2008 07:21:12 +0000 (07:21 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Wed, 30 Jul 2008 07:21:12 +0000 (07:21 +0000)
engine/kagecd.js

index 394c20e..d98915b 100755 (executable)
@@ -166,11 +166,11 @@ function cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a1, a2){
         }\r
       }\r
       else{ //bottom to up\r
-        if(x1 == x2){ //is it right?\r
+        if(x1 == x2){\r
           poly = new Polygon();\r
           poly.push(x1 - kage.kMinWidthT, y1);\r
           poly.push(x1 + kage.kMinWidthT, y1);\r
-          poly.push(x1 - kage.kMinWidthT, y1 + kage.kMinWidthY);\r
+          poly.push(x1 + kage.kMinWidthT, y1 - kage.kMinWidthY);\r
           polygons.push(poly);\r
         }\r
         else{\r
@@ -197,42 +197,35 @@ function cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a1, a2){
       if(y1 <= y4){ //from up to bottom\r
         if(x1 == x2){\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r
-          poly.push(x1 + kage.kMinWidthT + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r
-          poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2);\r
+                                       poly.push(x1 + kage.kMinWidthT, y1);\r
+                                       poly.push(x1 + kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
+          poly.push(x1 + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
-                    y1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+          poly.push(x1 + kage.kMinWidthT * XX,\r
+                    y1 + kage.kMinWidthT * XY);\r
+          poly.push(x1 + kage.kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX,\r
+                    y1 + kage.kMinWidthT * 1.5 * XY + kage.kMinWidthY * YY);\r
+          poly.push(x1 + kage.kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX,\r
+                    y1 + kage.kMinWidthT * 0.5 * XY + kage.kMinWidthY * 3 * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
       else{ //from bottom to up\r
-        if(x1 == x2){ //is it right?\r
+        if(x1 == x2){\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT, y1 - kage.kMinWidthY * 0.5);\r
-          poly.push(x1 + kage.kMinWidthT + kage.kMinWidthT * 0.5, y1 - kage.kMinWidthY * 0.5 - kage.kMinWidthY);\r
-          poly.push(x1 + kage.kMinWidthT, y1 - kage.kMinWidthY * 0.5 - kage.kMinWidthY * 2);\r
+          poly.push(x1 - kage.kMinWidthT, y1);\r
+          poly.push(x1 - kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
+          poly.push(x1 - kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
           polygons.push(poly);\r
         }\r
-        else{ //SETSUGOUMEN GA KAKERUNODE HOKYOU\r
+        else{\r
           poly = new Polygon();\r
-          poly.push(x1 - (kage.kMinWidthT - 1) * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 - (kage.kMinWidthT - 1) * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 0) * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 - (kage.kMinWidthT - 0) * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
-                    y1 - (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 0) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 - (kage.kMinWidthT - 0) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 1) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 - (kage.kMinWidthT - 1) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+          poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
+          poly.push(x1 - kage.kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kage.kMinWidthT * 1.5 * XY);\r
+          poly.push(x1 - kage.kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kage.kMinWidthT * 0.5 * XY);\r
           polygons.push(poly);\r
         }\r
       }\r
@@ -673,42 +666,35 @@ function cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a1, a2){
       if(y1 <= y3){ //from up to bottom\r
         if(x1 == x2){\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r
-          poly.push(x1 + kage.kMinWidthT + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r
-          poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2);\r
+          poly.push(x1 + kage.kMinWidthT, y1);\r
+          poly.push(x1 + kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
+          poly.push(x1 + kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
           polygons.push(poly);\r
         }\r
         else{\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
-                    y1 + (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
-          poly.push(x1 + kage.kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 + kage.kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+          poly.push(x1 + kage.kMinWidthT * XX,\r
+                    y1 + kage.kMinWidthT * XY);\r
+          poly.push(x1 + kage.kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX,\r
+                    y1 + kage.kMinWidthT * 1.5 * XY + kage.kMinWidthY * YY);\r
+          poly.push(x1 + kage.kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX,\r
+                    y1 + kage.kMinWidthT * 0.5 * XY + kage.kMinWidthY * 3 * YY);\r
           polygons.push(poly);\r
         }\r
       }\r
       else{ //from bottom to up\r
-        if(x1 == x2){ //is it right?\r
+        if(x1 == x2){\r
           poly = new Polygon();\r
-          poly.push(x1 + kage.kMinWidthT, poly2[0].Y = y1 - kage.kMinWidthY * 0.5);\r
-          poly.push(x1 + kage.kMinWidthT + kage.kMinWidthT * 0.5, y1 - kage.kMinWidthY * 0.5 - kage.kMinWidthY);\r
-          poly.push(x1 + kage.kMinWidthT, y1 - kage.kMinWidthY * 0.5 - kage.kMinWidthY * 2);\r
+          poly.push(x1 - kage.kMinWidthT, y1);\r
+          poly.push(x1 - kage.kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r
+          poly.push(x1 - kage.kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r
           polygons.push(poly);\r
         }\r
-        else{ //SETSUGOUMEN GA KAKERUNODE HOKYOU\r
+        else{\r
           poly = new Polygon();\r
-          poly.push(x1 - (kage.kMinWidthT - 1) * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 - (kage.kMinWidthT - 1) * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 0) * XX + (kage.kMinWidthY * 0.5) * YX,\r
-                    y1 - (kage.kMinWidthT - 0) * XY + (kage.kMinWidthY * 0.5) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
-                    y1 - (kage.kMinWidthT + kage.kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 0) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 - (kage.kMinWidthT - 0) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
-          poly.push(x1 - (kage.kMinWidthT - 1) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
-                    y1 - (kage.kMinWidthT - 1) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+          poly.push(x1 - kage.kMinWidthT * XX, y1 - kage.kMinWidthT * XY);\r
+          poly.push(x1 - kage.kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kage.kMinWidthT * 1.5 * XY);\r
+          poly.push(x1 - kage.kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kage.kMinWidthT * 0.5 * XY);\r
           polygons.push(poly);\r
         }\r
       }\r