Fixed a bug.(TOME half circle for straight line)
authorKoichi KAMICHI <kamichi@fonts.jp>
Tue, 16 Feb 2010 03:09:18 +0000 (03:09 +0000)
committerKoichi KAMICHI <kamichi@fonts.jp>
Tue, 16 Feb 2010 03:09:18 +0000 (03:09 +0000)
engine/kagecd.js

index fd80cf8..263524e 100755 (executable)
@@ -447,9 +447,9 @@ function cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, t
         if(kage.kUseCurve){\r
           // by curve path\r
           poly.push(x2 - kMinWidthT, y2);\r
-          poly.push(x2 - kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2 - kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r
           poly.push(x2, y2 + kMinWidthT);\r
-          poly.push(x2 + kMinWidthT, y2 + kMinWidthT, 1);\r
+          poly.push(x2 + kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r
           poly.push(x2 + kMinWidthT, y2);\r
         } else {\r
           // by polygon\r
@@ -813,11 +813,19 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
       \r
       if((a1 == 6 && a2 == 0) || a2 == 1){ //KAGI NO YOKO BOU NO SAIGO NO MARU ... no need only used at 1st=yoko\r
         poly = new Polygon();\r
-        poly.push(x2 - kMinWidthT, y2);\r
-        poly.push(x2 - kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
-        poly.push(x2, y2 + kMinWidthT);\r
-        poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
-        poly.push(x2 + kMinWidthT, y2);\r
+       if(kage.kUseCurve){\r
+          poly.push(x2 - kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r
+          poly.push(x2, y2 + kMinWidthT);\r
+          poly.push(x2 + kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r
+          poly.push(x2 + kMinWidthT, y2);\r
+        } else {\r
+          poly.push(x2 - kMinWidthT, y2);\r
+          poly.push(x2 - kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+          poly.push(x2, y2 + kMinWidthT);\r
+          poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+          poly.push(x2 + kMinWidthT, y2);\r
+        }\r
         poly.reverse(); // for fill-rule\r
         polygons.push(poly);\r
       }\r
@@ -834,11 +842,19 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         if(a2 == 1 || a2 == 0 || a2 == 5){ // no need a2=1\r
           //KAGI NO YOKO BOU NO SAIGO NO MARU\r
           poly = new Polygon();\r
-          poly.push(x2, y2 - kMinWidthT);\r
-          poly.push(x2 + kMinWidthT * 0.6, y2 - kMinWidthT * 0.6);\r
-          poly.push(x2 + kMinWidthT, y2);\r
-          poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
-          poly.push(x2, y2 + kMinWidthT);\r
+          if(kage.kUseCurve){\r
+            poly.push(x2, y2 - kMinWidthT);\r
+            poly.push(x2 + kMinWidthT * 0.9, y2 - kMinWidthT * 0.9, 1);\r
+            poly.push(x2 + kMinWidthT, y2);\r
+            poly.push(x2 + kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r
+            poly.push(x2, y2 + kMinWidthT);\r
+          } else {\r
+            poly.push(x2, y2 - kMinWidthT);\r
+            poly.push(x2 + kMinWidthT * 0.6, y2 - kMinWidthT * 0.6);\r
+            poly.push(x2 + kMinWidthT, y2);\r
+            poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r
+            poly.push(x2, y2 + kMinWidthT);\r
+          }\r
           polygons.push(poly);\r
         }\r
         \r
@@ -966,13 +982,23 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         \r
         if((a1 == 6) && (a2 == 0 || a2 == 5)){ //KAGI NO YOKO BOU NO SAIGO NO MARU\r
           poly = new Polygon();\r
-          poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v + Math.sin(rad) * kMinWidthT * 0.6 * v,\r
-                    y2 + Math.sin(rad) * kMinWidthT * 0.8 * v - Math.cos(rad) * kMinWidthT * 0.6 * v);\r
-          poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
-          poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v - Math.sin(rad) * kMinWidthT * 0.6 * v,\r
-                    y2 + Math.sin(rad) * kMinWidthT * 0.8 * v + Math.cos(rad) * kMinWidthT * 0.6 * v);\r
-          poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
+          if(kage.kUseCurve){\r
+            poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.9 * v + Math.sin(rad) * kMinWidthT * 0.9 * v,\r
+                      y2 + Math.sin(rad) * kMinWidthT * 0.9 * v - Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.9 * v - Math.sin(rad) * kMinWidthT * 0.9 * v,\r
+                      y2 + Math.sin(rad) * kMinWidthT * 0.9 * v + Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r
+            poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
+          } else {\r
+            poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v + Math.sin(rad) * kMinWidthT * 0.6 * v,\r
+                      y2 + Math.sin(rad) * kMinWidthT * 0.8 * v - Math.cos(rad) * kMinWidthT * 0.6 * v);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r
+            poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v - Math.sin(rad) * kMinWidthT * 0.6 * v,\r
+                      y2 + Math.sin(rad) * kMinWidthT * 0.8 * v + Math.cos(rad) * kMinWidthT * 0.6 * v);\r
+            poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
+          }\r
           polygons.push(poly);\r
         }\r
         \r