//KAGI NO YOKO BOU NO SAIGO NO MARU\r
poly = new Polygon();\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
+ if(x1 < x2){\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.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
+ }\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
+ if(x1 < x2){\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
+ } 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
}\r
polygons.push(poly);\r
}\r
if(a2 == 5){\r
//KAGI NO YOKO BOU NO HANE\r
poly = new Polygon();\r
- poly.push(x2, y2 - kMinWidthT + 1);\r
- poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * 5);\r
- poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r
- poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r
+ if(x1 < x2){\r
+ poly.push(x2, y2 - kMinWidthT + 1);\r
+ poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * 5);\r
+ poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r
+ poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r
+ } else {\r
+ poly.push(x2, y2 - kMinWidthT + 1);\r
+ poly.push(x2 - 2, y2 - kMinWidthT - kage.kWidth * 5);\r
+ poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r
+ poly.push(x2 + kMinWidthT, y2 - kMinWidthT + 1);\r
+ }\r
poly.reverse(); // for fill-rule\r
polygons.push(poly);\r
}\r
poly = new Polygon();\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
+ 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
if(a1 == 6 && a2 == 5){\r
//KAGI NO YOKO BOU NO HANE\r
poly = new Polygon();\r
- poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kMinWidthT - 1) * Math.cos(rad) * v);\r
- poly.push(x2 + 2 * Math.cos(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
- y2 + 2 * Math.sin(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
- poly.push(x2 + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
- y2 - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
- poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r
- y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r
+ if(x1 < x2){\r
+ poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kMinWidthT - 1) * Math.cos(rad) * v);\r
+ poly.push(x2 + 2 * Math.cos(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+ y2 + 2 * Math.sin(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+ poly.push(x2 + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+ y2 - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+ poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r
+ y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r
+ } else {\r
+ poly.push(x2 - (kMinWidthT - 1) * Math.sin(rad) * v, y2 + (kMinWidthT - 1) * Math.cos(rad) * v);\r
+ poly.push(x2 + 2 * Math.cos(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+ y2 + 2 * Math.sin(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+ poly.push(x2 - (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r
+ y2 + (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r
+ poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r
+ y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r
+ }\r
polygons.push(poly);\r
}\r
\r