+// may be it can join 3curve and 4curve. the difference is may be only calculating x,y,ix,iy\r
+\r
function cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a1, a2){\r
var rad, t;\r
var x, y, v;\r
delta = -1 * kage.kMinWidthY * 0.5;\r
break;\r
case 1:\r
- case 2:\r
+ case 2: // must be 32\r
case 6:\r
case 22:\r
delta = 0;\r
case 8:\r
case 7:\r
case 9:\r
- case 15:\r
- case 14:\r
- case 17:\r
+ case 15: // it can change to 15->5\r
+ case 14: // it can change to 14->4\r
+ case 17: // no need\r
case 5:\r
delta = 0;\r
break;\r
}\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
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
poly.push(x1 + kage.kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthT);\r
- poly.push(x1 - kage.kMinWidthT, y1);\r
+ poly.push(x1, y1 + kage.kMinWidthT);\r
polygons.push(poly);\r
}\r
\r
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
XX = Math.cos(rad) * v;\r
XY = Math.sin(rad) * v;\r
\r
- if(a2 == 1 || a2 == 8 || a2 == 15){ //the last filled circle\r
+ if(a2 == 1 || a2 == 8 || a2 == 15){ //the last filled circle ... it can change to 15->5\r
if(x3 == x4){\r
poly = Polygon();\r
poly.push(x4 - kage.kMinWidthT, y4);\r
- poly.push(x4 - kage.kMinWidthT * 0.6, y4 + kage.kMinWidthT * 0.6);\r
+ poly.push(x4 - kage.kMinWidthT * 0.7, y4 + kage.kMinWidthT * 0.7);\r
poly.push(x4, y4 + kage.kMinWidthT);\r
- poly.push(x4 + kage.kMinWidthT * 0.6, y4 + kage.kMinWidthT * 0.6);\r
+ poly.push(x4 + kage.kMinWidthT * 0.7, y4 + kage.kMinWidthT * 0.7);\r
poly.push(x4 + kage.kMinWidthT, y4);\r
polygons.push(poly);\r
}\r
else if(y3 == y4){\r
poly = new Polygon();\r
poly.push(x4, y4 - kage.kMinWidthT);\r
- poly.push(x4 + kage.kMinWidthT * 0.6, y4 - kage.kMinWidthT * 0.6);\r
+ poly.push(x4 + kage.kMinWidthT * 0.7, y4 - kage.kMinWidthT * 0.7);\r
poly.push(x4 + kage.kMinWidthT, y4);\r
- poly.push(x4 + kage.kMinWidthT * 0.6, y4 + kage.kMinWidthT * 0.6);\r
+ poly.push(x4 + kage.kMinWidthT * 0.7, y4 + kage.kMinWidthT * 0.7);\r
poly.push(x4, y4 + kage.kMinWidthT);\r
polygons.push(poly);\r
}\r
else{\r
poly = new Polygon();\r
poly.push(x4 + Math.sin(rad) * kage.kMinWidthT * v, y4 - Math.cos(rad) * kage.kMinWidthT * v);\r
- poly.push(x4 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v + Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
- y4 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v - Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
+ poly.push(x4 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v + Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
+ y4 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v - Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
poly.push(x4 + Math.cos(rad) * kage.kMinWidthT * v, y4 + Math.sin(rad) * kage.kMinWidthT * v);\r
- poly.push(x4 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v - Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
- y4 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v + Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
+ poly.push(x4 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v - Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
+ y4 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v + Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
poly.push(x4 - Math.sin(rad) * kage.kMinWidthT * v, y4 + Math.cos(rad) * kage.kMinWidthT * v);\r
polygons.push(poly);\r
}\r
}\r
}\r
\r
- if(a2 == 15){ //jump up\r
+ if(a2 == 15){ //jump up ... it can change to 15->5\r
if(y3 == y4){\r
poly = new Polygon();\r
poly.push(x4, y4 - kage.kMinWidthT + 1);\r
}\r
}\r
\r
- if(a2 == 14){ //jump to left, allways go left\r
+ if(a2 == 14){ //jump to left, allways go left ... it can change to 14->4\r
poly = new Polygon();\r
poly.push(x4, y4);\r
poly.push(x4, y4 - kage.kMinWidthT);\r
delta = -1 * kage.kMinWidthY * 0.5;\r
break;\r
case 1:\r
- case 2:\r
+ case 2: // ... must be 32\r
case 6:\r
case 22:\r
delta = 0;\r
case 1:\r
case 7:\r
case 9:\r
- case 15:\r
- case 14:\r
- case 17:\r
+ case 15: // it can change to 15->5\r
+ case 14: // it can change to 14->4\r
+ case 17: // no need\r
case 5:\r
delta = 0;\r
break;\r
}\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
poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r
poly.push(x1 + kage.kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r
poly.push(x1 + kage.kMinWidthT, y1 + kage.kMinWidthT);\r
- poly.push(x1 - kage.kMinWidthT, y1);\r
+ poly.push(x1, y1 + kage.kMinWidthT);\r
polygons.push(poly);\r
}\r
\r
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
XX = Math.cos(rad) * v;\r
XY = Math.sin(rad) * v;\r
\r
- if(a2 == 1 || a2 == 8 || a2 == 15){ //the last filled circle\r
+ if(a2 == 1 || a2 == 8 || a2 == 15){ //the last filled circle ... it can change 15->5\r
if(x2 == x3){\r
poly = new Polygon();\r
poly.push(x3 - kage.kMinWidthT, y3);\r
- poly.push(x3 - kage.kMinWidthT * 0.6, y3 + kage.kMinWidthT * 0.6);\r
+ poly.push(x3 - kage.kMinWidthT * 0.7, y3 + kage.kMinWidthT * 0.7);\r
poly.push(x3, y3 + kage.kMinWidthT);\r
- poly.push(x3 + kage.kMinWidthT * 0.6, y3 + kage.kMinWidthT * 0.6);\r
+ poly.push(x3 + kage.kMinWidthT * 0.7, y3 + kage.kMinWidthT * 0.7);\r
poly.push(x3 + kage.kMinWidthT, y3);\r
polygons.push(poly);\r
}\r
else if(y2 == y3){\r
poly = new Polygon();\r
poly.push(x3, y3 - kage.kMinWidthT);\r
- poly.push(x3 + kage.kMinWidthT * 0.6, y3 - kage.kMinWidthT * 0.6);\r
+ poly.push(x3 + kage.kMinWidthT * 0.7, y3 - kage.kMinWidthT * 0.7);\r
poly.push(x3 + kage.kMinWidthT, y3);\r
- poly.push(x3 + kage.kMinWidthT * 0.6, y3 + kage.kMinWidthT * 0.6);\r
+ poly.push(x3 + kage.kMinWidthT * 0.7, y3 + kage.kMinWidthT * 0.7);\r
poly.push(x3, y3 + kage.kMinWidthT);\r
polygons.push(poly);\r
}\r
else{\r
poly = new Polygon();\r
poly.push(x3 + Math.sin(rad) * kage.kMinWidthT * v, y3 - Math.cos(rad) * kage.kMinWidthT * v);\r
- poly.push(x3 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v + Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
- y3 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v - Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
+ poly.push(x3 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v + Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
+ y3 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v - Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
poly.push(x3 + Math.cos(rad) * kage.kMinWidthT * v, y3 + Math.sin(rad) * kage.kMinWidthT * v);\r
- poly.push(x3 + Math.cos(rad) * kage.kMinWidthT * 0.8 * v - Math.sin(rad) * kage.kMinWidthT * 0.6 * v,\r
- y3 + Math.sin(rad) * kage.kMinWidthT * 0.8 * v + Math.cos(rad) * kage.kMinWidthT * 0.6 * v);\r
+ poly.push(x3 + Math.cos(rad) * kage.kMinWidthT * 0.7 * v - Math.sin(rad) * kage.kMinWidthT * 0.7 * v,\r
+ y3 + Math.sin(rad) * kage.kMinWidthT * 0.7 * v + Math.cos(rad) * kage.kMinWidthT * 0.7 * v);\r
poly.push(x3 - Math.sin(rad) * kage.kMinWidthT * v, y3 + Math.cos(rad) * kage.kMinWidthT * v);\r
polygons.push(poly);\r
}\r
}\r
\r
- if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Math.sinnyu & L2RD Harai\r
+ if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Math.sinnyu & L2RD Harai ... no need for a2=9\r
if(y2 == y3){\r
poly = new Polygon();\r
poly.push(x3, y3 + kage.kMinWidthT * kage.kL2RDfatten);\r
}\r
}\r
\r
- if(a2 == 15){ //jump up\r
+ if(a2 == 15){ //jump up ... it can change 15->5\r
if(y2 == y3){\r
poly = new Polygon();\r
poly.push(x3, y3 - kage.kMinWidthT + 1);\r
}\r
}\r
\r
- if(a2 == 14){ //jump to left, allways go left\r
+ if(a2 == 14){ //jump to left, allways go left ... it can change 14->4\r
poly = new Polygon();\r
poly.push(x3, y3);\r
poly.push(x3, y3 - kage.kMinWidthT);\r
poly.set(0, x1 + kage.kMinWidthT, y1 + kage.kMinWidthY / 2);\r
break;\r
case 1:\r
- case 6:\r
+ case 6: //... no need\r
case 22:\r
poly.set(3, x1 - kage.kMinWidthT, y1);\r
poly.set(0, x1 + kage.kMinWidthT, y1);\r
\r
switch(a2){\r
case 0:\r
- if(a1 == 6){ //KAGI's tail\r
+ if(a1 == 6){ //KAGI's tail ... no need\r
poly.set(2, x2 - kage.kMinWidthT, y2);\r
poly.set(1, x2 + kage.kMinWidthT, y2);\r
}\r
polygons.push(poly);\r
}\r
\r
- if((a1 == 6 && a2 == 0) || a2 == 1){ //KAGI NO YOKO BOU NO SAIGO NO MARU\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 - kage.kMinWidthT, y2);\r
poly.push(x2 - kage.kMinWidthT * 0.6, y2 + kage.kMinWidthT * 0.6);\r
poly.push(x1, y1 + kage.kMinWidthT);\r
polygons.push(poly);\r
\r
- if(a2 == 1 || a2 == 0 || a2 == 5){\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 - kage.kMinWidthT);\r
}\r
else{ //for others, use x-axis\r
rad = Math.atan((y2 - y1) / (x2 - x1));\r
- if((Math.abs(y2 - y1) < Math.abs(x2 - x1)) && (a1 != 6) && (a2 != 6)){ //ASAI KAUDO\r
+ if((Math.abs(y2 - y1) < Math.abs(x2 - x1)) && (a1 != 6) && (a2 != 6) && !(x1 > x2)){ //ASAI KAUDO\r
poly = new Polygon(4);\r
switch(a1){ //must be 0 or 2\r
case 0:\r
y2 + Math.cos(rad) * kage.kMinWidthT * v + kage.kMinWidthT * 0.5 * Math.sin(rad) * v);\r
}\r
break;\r
- case 1:\r
+ case 1: // is needed?\r
case 5:\r
poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthT * v, y2 - Math.cos(rad) * kage.kMinWidthT * v);\r
poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthT * v, y2 + Math.cos(rad) * kage.kMinWidthT * v);\r