set polygons to counter-clockwise
[chise/kage.git] / engine / curve.js
index d7be0b6..7acb013 100644 (file)
@@ -125,7 +125,7 @@ function find_offcurve(kage, curve, sx, sy, result){
 }\r
 \r
 // ------------------------------------------------------------------\r
-function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3){\r
+function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3, opt4){\r
   var x, y, ix, iy, ir, ia, ib, tt, t, deltad;\r
   var hosomi = 0.5;\r
   \r
@@ -167,7 +167,7 @@ function get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3){
       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
+      deltad = (((kage.kMinWidthT - opt4 / 2) - opt3 / 2) / (kage.kMinWidthT - opt4 / 2)) + opt3 / 2 / (kage.kMinWidthT - opt4) * t;\r
     }\r
     else{ deltad = 1; }\r
     \r