var poly, poly2;\r
var hosomi;\r
var kMinWidthT, kMinWidthT2;\r
- var a1, a2, opt1, opt2, opt3;\r
+ var a1, a2, opt1, opt2, opt3, opt4;\r
\r
if(kage.kShotai == kage.kMincho){ // mincho\r
a1 = ta1 % 1000;\r
a2 = ta2 % 100;\r
opt1 = Math.floor((ta1 % 10000) / 1000);\r
- opt2 = Math.floor(ta2 / 100);\r
+ opt2 = Math.floor((ta2 % 1000) / 100);\r
opt3 = Math.floor(ta1 / 10000);\r
+ opt4 = Math.floor(ta2 / 1000);\r
\r
kMinWidthT = kage.kMinWidthT - opt1 / 2;\r
- kMinWidthT2 = kage.kMinWidthT - opt3 / 2;\r
+ kMinWidthT2 = kage.kMinWidthT - opt4 / 2;\r
\r
switch(a1 % 100){\r
case 0:\r
kage2.kRate = 10;\r
\r
var curve = new Array(2); // L and R\r
- get_candidate(kage2, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3);\r
+ get_candidate(kage2, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3, opt4);\r
\r
var dcl12_34 = new Array(2);\r
var dcr12_34 = new Array(2);\r
else if(a2 == 7){\r
deltad = Math.pow(1.0 - t, hosomi);\r
}\r
- else if(opt3 > 0){\r
- deltad = ((kage.kMinWidthT - opt3 / 2) / kage.kMinWidthT) + opt3 / 2 / kage.kMinWidthT * t;\r
+ else if(opt3 > 0 || opt4 > 0){\r
+ deltad = ((kage.kMinWidthT - opt3 / 2) - (opt4 - opt3) / 2 * t) / kage.kMinWidthT;\r
}\r
else{ deltad = 1; }\r
\r
poly.unshift(newx2, newy2);\r
}\r
\r
+ // suiheisen ni setsuzoku 2\r
+ if(a1 == 22 && y1 > y2){\r
+ var index = 0;\r
+ while(true){\r
+ if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r
+ break;\r
+ }\r
+ index++;\r
+ }\r
+ newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r
+ (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r
+ newy1 = y1;\r
+ newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x - 1) * (poly.array[0].y - y1) /\r
+ (poly.array[1].y - poly.array[0].y);\r
+ newy2 = y1 + 1;\r
+ \r
+ for(var i = 0; i < index; i++){\r
+ poly2.shift();\r
+ }\r
+ poly2.set(0, newx1, newy1);\r
+ poly.unshift(newx2, newy2);\r
+ }\r
+ \r
poly2.reverse();\r
poly.concat(poly2);\r
polygons.push(poly);\r
poly.unshift(newx2, newy2);\r
}\r
\r
+ // suiheisen ni setsuzoku 2\r
+ if(a1 == 22){\r
+ var index = 0;\r
+ while(true){\r
+ if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r
+ break;\r
+ }\r
+ index++;\r
+ }\r
+ newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r
+ (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r
+ newy1 = y1;\r
+ newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x - 1) * (poly.array[0].y - y1) /\r
+ (poly.array[1].y - poly.array[0].y);\r
+ newy2 = y1 + 1;\r
+ \r
+ for(var i = 0; i < index; i++){\r
+ poly2.shift();\r
+ }\r
+ poly2.set(0, newx1, newy1);\r
+ poly.unshift(newx2, newy2);\r
+ }\r
+ \r
poly2.reverse();\r
poly.concat(poly2);\r
polygons.push(poly);\r
}\r
if(x1 == sx1){\r
poly = new Polygon();\r
- poly.push(x1 - kMinWidthT, y1);\r
+ poly.push(x1 - kMinWidthT, y1 + 1);\r
poly.push(x1 + kMinWidthT, y1);\r
poly.push(x1 - kMinWidthT * pm, y1 - kage.kMinWidthY * type * pm);\r
+ //if(x1 > x2){\r
+ // poly.reverse();\r
+ //}\r
polygons.push(poly);\r
}\r
else{\r
poly = new Polygon();\r
- poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
+ poly.push(x1 - kMinWidthT * XX + 1 * YX, y1 - kMinWidthT * XY + 1 * YY);\r
poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r
poly.push(x1 - kMinWidthT * pm * XX - kage.kMinWidthY * type * pm * YX, y1 - kMinWidthT * pm * XY - kage.kMinWidthY * type * pm * YY);\r
+ //if(x1 > x2){\r
+ // poly.reverse();\r
+ //}\r
polygons.push(poly);\r
}\r
}\r
poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r
poly.push(x1 + kMinWidthT * XX - kage.kMinWidthY * YX, y1 + kMinWidthT * XY - kage.kMinWidthY * YY);\r
+ //if(x1 < x2){\r
+ // poly.reverse();\r
+ //}\r
polygons.push(poly);\r
}\r
}\r
poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
- poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r
- poly.push(x1, y1 + kMinWidthT);\r
+ poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1);\r
+ poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4);\r
polygons.push(poly);\r
}\r
\r
poly = new Polygon();\r
poly.push(x1 + kMinWidthT, y1 - move);\r
poly.push(x1 + kMinWidthT * 1.5, y1 + kage.kMinWidthY - move);\r
- poly.push(x1 + kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3 - move / 2);\r
+ poly.push(x1 + kMinWidthT - 2, y1 + kage.kMinWidthY * 2 + 1);\r
polygons.push(poly);\r
}\r
else{\r
y1 + kMinWidthT * XY - move * YY);\r
poly.push(x1 + kMinWidthT * 1.5 * XX + (kage.kMinWidthY - move * 1.2) * YX,\r
y1 + kMinWidthT * 1.5 * XY + (kage.kMinWidthY - move * 1.2) * YY);\r
- poly.push(x1 + kMinWidthT * 0.5 * XX + (kage.kMinWidthY * 3 - move * 0.8) * YX,\r
- y1 + kMinWidthT * 0.5 * XY + (kage.kMinWidthY * 3 - move * 0.8) * YY);\r
+ poly.push(x1 + (kMinWidthT - 2) * XX + (kage.kMinWidthY * 2 - move * 0.8 + 1) * YX,\r
+ y1 + (kMinWidthT - 2) * XY + (kage.kMinWidthY * 2 - move * 0.8 + 1) * YY);\r
+ //if(x1 < x2){\r
+ // poly.reverse();\r
+ //}\r
polygons.push(poly);\r
}\r
}\r
poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r
poly.push(x1 - kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kMinWidthT * 1.5 * XY);\r
poly.push(x1 - kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kMinWidthT * 0.5 * XY);\r
+ //if(x1 < x2){\r
+ // poly.reverse();\r
+ //}\r
polygons.push(poly);\r
}\r
}\r
poly = new Polygon();\r
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, y2 + kMinWidthT);\r
- poly.push(x2 + kMinWidthT, y2 + kMinWidthT, 1);\r
- poly.push(x2 + kMinWidthT, y2);\r
+ poly.push(x2 - kMinWidthT2, y2);\r
+ poly.push(x2 - kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r
+ poly.push(x2, y2 + kMinWidthT2);\r
+ poly.push(x2 + kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r
+ poly.push(x2 + kMinWidthT2, y2);\r
} else {\r
// by polygon\r
- poly.push(x2 - kMinWidthT, y2);\r
- poly.push(x2 - kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
- poly.push(x2, y2 + kMinWidthT);\r
- poly.push(x2 + kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
- poly.push(x2 + kMinWidthT, y2);\r
+ poly.push(x2 - kMinWidthT2, y2);\r
+ poly.push(x2 - kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r
+ poly.push(x2, y2 + kMinWidthT2);\r
+ poly.push(x2 + kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r
+ poly.push(x2 + kMinWidthT2, y2);\r
}\r
polygons.push(poly);\r
}\r
poly = new Polygon();\r
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, y2 + kMinWidthT);\r
- poly.push(x2 + kMinWidthT, y2 + kMinWidthT, 1);\r
- poly.push(x2 + kMinWidthT, y2);\r
+ poly.push(x2, y2 - kMinWidthT2);\r
+ poly.push(x2 + kMinWidthT2 * 0.9, y2 - kMinWidthT2 * 0.9, 1);\r
+ poly.push(x2 + kMinWidthT2, y2);\r
+ poly.push(x2 + kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r
+ poly.push(x2, y2 + kMinWidthT2);\r
} else {\r
// by polygon\r
- poly.push(x2, y2 - kMinWidthT);\r
- poly.push(x2 + kMinWidthT * 0.7, y2 - kMinWidthT * 0.7);\r
- poly.push(x2 + kMinWidthT, y2);\r
- poly.push(x2 + kMinWidthT * 0.7, y2 + kMinWidthT * 0.7);\r
- poly.push(x2, y2 + kMinWidthT);\r
+ poly.push(x2, y2 - kMinWidthT2);\r
+ poly.push(x2 + kMinWidthT2 * 0.7, y2 - kMinWidthT2 * 0.7);\r
+ poly.push(x2 + kMinWidthT2, y2);\r
+ poly.push(x2 + kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r
+ poly.push(x2, y2 + kMinWidthT2);\r
}\r
polygons.push(poly);\r
}\r
else{\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
- 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
+ poly.push(x2 + Math.sin(rad) * kMinWidthT2 * v, y2 - Math.cos(rad) * kMinWidthT2 * v);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.9 * v + Math.sin(rad) * kMinWidthT2 * 0.9 * v,\r
+ y2 + Math.sin(rad) * kMinWidthT2 * 0.9 * v - Math.cos(rad) * kMinWidthT2 * 0.9 * v, 1);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * v, y2 + Math.sin(rad) * kMinWidthT2 * v);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.9 * v - Math.sin(rad) * kMinWidthT2 * 0.9 * v,\r
+ y2 + Math.sin(rad) * kMinWidthT2 * 0.9 * v + Math.cos(rad) * kMinWidthT2 * 0.9 * v, 1);\r
+ poly.push(x2 - Math.sin(rad) * kMinWidthT2 * v, y2 + Math.cos(rad) * kMinWidthT2 * 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.7 * v + Math.sin(rad) * kMinWidthT * 0.7 * v,\r
- y2 + Math.sin(rad) * kMinWidthT * 0.7 * v - Math.cos(rad) * kMinWidthT * 0.7 * 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.7 * v - Math.sin(rad) * kMinWidthT * 0.7 * v,\r
- y2 + Math.sin(rad) * kMinWidthT * 0.7 * v + Math.cos(rad) * kMinWidthT * 0.7 * v);\r
- poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r
+ poly.push(x2 + Math.sin(rad) * kMinWidthT2 * v, y2 - Math.cos(rad) * kMinWidthT2 * v);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.7 * v + Math.sin(rad) * kMinWidthT2 * 0.7 * v,\r
+ y2 + Math.sin(rad) * kMinWidthT2 * 0.7 * v - Math.cos(rad) * kMinWidthT2 * 0.7 * v);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * v, y2 + Math.sin(rad) * kMinWidthT2 * v);\r
+ poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.7 * v - Math.sin(rad) * kMinWidthT2 * 0.7 * v,\r
+ y2 + Math.sin(rad) * kMinWidthT2 * 0.7 * v + Math.cos(rad) * kMinWidthT2 * 0.7 * v);\r
+ poly.push(x2 - Math.sin(rad) * kMinWidthT2 * v, y2 + Math.cos(rad) * kMinWidthT2 * v);\r
}\r
polygons.push(poly);\r
}\r
}\r
\r
if(a2 == 15){ //jump up ... it can change 15->5\r
- if(sy2 == y2){\r
- poly = new Polygon();\r
+ // anytime same degree\r
+ poly = new Polygon();\r
+ if(y1 < y2){\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
- polygons.push(poly);\r
- }\r
- else{\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
- polygons.push(poly);\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
+ polygons.push(poly);\r
}\r
\r
if(a2 == 14){ //jump to left, allways go left\r
poly.push(x2, y2 - kMinWidthT);\r
poly.push(x2 - kage.kWidth * 4 * Math.pow(kMinWidthT / kage.kMinWidthT, 3), y2 - kMinWidthT);\r
poly.push(x2 - kage.kWidth * 4 * Math.pow(kMinWidthT / kage.kMinWidthT, 3), y2 - kMinWidthT * 0.5);\r
+ //poly.reverse();\r
polygons.push(poly);\r
}\r
}\r
y1 = ty1;\r
x2 = tx2;\r
y2 = ty2;\r
- a1 = ta1 % 100;\r
+ a1 = ta1 % 1000;\r
a2 = ta2 % 100;\r
- opt1 = Math.floor(ta1 / 100);\r
+ opt1 = Math.floor(ta1 / 1000);\r
opt2 = Math.floor(ta2 / 100);\r
\r
kMinWidthT = kage.kMinWidthT - opt1 / 2;\r
poly = new Polygon();\r
poly.push(x1 + kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r
poly.push(x1 + kMinWidthT + kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r
- poly.push(x1 + kMinWidthT, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2);\r
+ poly.push(x1 + kMinWidthT - 2, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2 + 1);\r
polygons.push(poly);\r
}\r
\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
- poly.reverse(); // for fill-rule\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
}\r
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
+ 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
+ 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
\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
- poly.reverse(); // for fill-rule\r
+ if(x1 < x2){\r
+ poly.push(x2, y2 - kMinWidthT + 1);\r
+ poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r
+ poly.push(x2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\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 * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r
+ poly.push(x2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r
+ poly.push(x2 + kMinWidthT, y2 - kMinWidthT + 1);\r
+ }\r
+ //poly.reverse(); // for fill-rule\r
polygons.push(poly);\r
}\r
}\r
break;\r
case 1:\r
case 6:\r
- case 22:\r
poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v, y1 - Math.cos(rad) * kMinWidthT * v);\r
poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v, y1 + Math.cos(rad) * kMinWidthT * v);\r
break;\r
poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.cos(rad) * v,\r
y1 + Math.cos(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.sin(rad) * v);\r
break;\r
+ case 22:\r
+ poly.set(0, x1 + (kMinWidthT * v + 1) / Math.sin(rad), y1 + 1);\r
+ poly.set(3, x1 - (kMinWidthT * v) / Math.sin(rad), y1);\r
+ break;\r
case 32:\r
- poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
- y1 - Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
- poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r
- y1 + Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r
+ poly.set(0, x1 + (kMinWidthT * v) / Math.sin(rad), y1);\r
+ poly.set(3, x1 - (kMinWidthT * v) / Math.sin(rad), y1);\r
break;\r
}\r
\r
y2 + Math.cos(rad) * kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kMinWidthT) * Math.sin(rad) * v);\r
break;\r
case 32:\r
- poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
- y2 - Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
- poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * v,\r
- y2 + Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * v);\r
+ poly.set(1, x2 + (kMinWidthT * v) / Math.sin(rad), y2);\r
+ poly.set(2, x2 - (kMinWidthT * v) / Math.sin(rad), y2);\r
break;\r
}\r
\r
\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
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
poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
- poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r
- poly.push(x1 - kMinWidthT, y1);\r
+ poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1);\r
+ poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4);\r
polygons.push(poly);\r
}\r
\r
y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r
poly.push(x1 + (kMinWidthT + kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r
y1 + (kMinWidthT + kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r
- poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX,\r
- y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY);\r
+ poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX - 2 * XX,\r
+ y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY + 1 * XY);\r
polygons.push(poly);\r
}\r
}\r
poly.push(x2 - kage.kWidth, y2);\r
poly.push(x2 + kage.kWidth, y2);\r
poly.push(x1 + kage.kWidth, y1);\r
- poly.reverse(); // for fill-rule\r
+ //poly.reverse(); // for fill-rule\r
\r
polygons.push(poly);\r
}\r