Supports new G/T left-bottom corner's shape.
authorKoichi Kamichi <kamichi@ic.daito.ac.jp>
Mon, 11 Jan 2016 15:31:18 +0000 (00:31 +0900)
committerKoichi Kamichi <kamichi@ic.daito.ac.jp>
Mon, 11 Jan 2016 15:31:18 +0000 (00:31 +0900)
kage.js
kagecd.js

diff --git a/kage.js b/kage.js
index c58fda5..0966119 100644 (file)
--- a/kage.js
+++ b/kage.js
@@ -97,9 +97,9 @@ function Kage(size){
     var box = this.getBox(buhin);\r
       if(sx != 0 || sy != 0){\r
          if(sx > 100){\r
-             sx -= 200; // Ç¤°ÕÅÀ¥â¡¼¥É\r
+             sx -= 200;\r
          } else {\r
-             sx2 = 0; // Ãæ¿´ÅÀ¥â¡¼¥É\r
+             sx2 = 0;\r
              sy2 = 0;\r
          }\r
       }\r
@@ -376,7 +376,7 @@ function Kage(size){
     this.kMage = 6;\r
     this.kUseCurve = 0;\r
     \r
-    this.kAdjustKakatoL = ([8, 5, 3, 1]); // for KAKATO adjustment 000,100,200,300\r
+    this.kAdjustKakatoL = ([8, 5, 3, 1, 0]); // for KAKATO adjustment 000,100,200,300,400\r
     this.kAdjustKakatoR = ([4, 3, 2, 1]); // for KAKATO adjustment 000,100,200,300\r
     this.kAdjustKakatoRangeX = 12; // check area width\r
     this.kAdjustKakatoRangeY = ([1, 11, 14, 18]); // 3 steps of checking\r
@@ -396,7 +396,7 @@ function Kage(size){
     this.kMage = 10;\r
     this.kUseCurve = 0;\r
     \r
-    this.kAdjustKakatoL = ([14, 9, 5, 2]); // for KAKATO adjustment 000,100,200,300\r
+    this.kAdjustKakatoL = ([14, 9, 5, 2, 0]); // for KAKATO adjustment 000,100,200,300,400\r
     this.kAdjustKakatoR = ([8, 6, 4, 2]); // for KAKATO adjustment 000,100,200,300\r
     this.kAdjustKakatoRangeX = 20; // check area width\r
     this.kAdjustKakatoRangeY = ([1, 19, 24, 30]); // 3 steps of checking\r
index 914cdbb..220df57 100644 (file)
--- a/kagecd.js
+++ b/kagecd.js
@@ -840,9 +840,13 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
         poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoL[opt2]);\r
         break;\r
       case 23:\r
-        poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT);\r
+       poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT);\r
         poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoR[opt2]);\r
-        break;\r
+       break;\r
+      case 24: //for T/H design\r
+        poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY);\r
+        poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY);\r
+       break;\r
       case 32:\r
         poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY);\r
         poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY);\r
@@ -850,6 +854,24 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
       }\r
       \r
       polygons.push(poly);\r
+\r
+      if(a2 == 24){ //for T design\r
+        poly = new Polygon();\r
+        poly.push(x2, y2 + kage.kMinWidthY);\r
+        poly.push(x2 + kMinWidthT, y2 - kage.kMinWidthY * 3);\r
+        poly.push(x2 + kMinWidthT * 2, y2 - kage.kMinWidthY);\r
+        poly.push(x2 + kMinWidthT * 2, y2 + kage.kMinWidthY);\r
+        polygons.push(poly);\r
+      }\r
+\r
+      if(a2 == 13 && opt2 == 4){ //for new GTH box's left bottom corner\r
+        poly = new Polygon();\r
+        poly.push(x2 - kMinWidthT, y2 - kage.kMinWidthY * 3);\r
+        poly.push(x2 - kMinWidthT * 2, y2);\r
+        poly.push(x2 - kage.kMinWidthY, y2 + kage.kMinWidthY * 5);\r
+        poly.push(x2 + kMinWidthT, y2 + kage.kMinWidthY);\r
+        polygons.push(poly);\r
+      }\r
       \r
       if(a1 == 22){ //box's right top corner\r
         poly = new Polygon();\r
@@ -1114,7 +1136,17 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){
           poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4);\r
           polygons.push(poly);\r
         }\r
-        \r
+\r
+\r
+        if(a2 == 13 && opt2 == 4){ //for new GTH box's left bottom corner MUKI KANKEINASHI\r
+          poly = new Polygon();\r
+          poly.push(x2 - kMinWidthT, y2 - kage.kMinWidthY * 3);\r
+          poly.push(x2 - kMinWidthT * 2, y2);\r
+          poly.push(x2 - kage.kMinWidthY, y2 + kage.kMinWidthY * 5);\r
+          poly.push(x2 + kMinWidthT, y2 + kage.kMinWidthY);\r
+          polygons.push(poly);\r
+        }\r
+\r
         XX = Math.sin(rad) * v;\r
         XY = Math.cos(rad) * v * -1;\r
         YX = Math.cos(rad) * v;\r