]> O.S.I.I.S - jp/vkvg.git/commitdiff
debug nx et ny < 0
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 19 Apr 2018 18:49:59 +0000 (20:49 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 19 Apr 2018 18:49:59 +0000 (20:49 +0200)
src/vkvg_context.c

index c063a5088c83be893420ab8a8a8342a83b902236..76d854cfb80539ba0a5d2d9a34c294cf9fbc06d7 100644 (file)
@@ -389,7 +389,7 @@ void vkvg_stroke_preserve (VkvgContext ctx)
                 if (n.y < 0){
                     a = asin(n.y);
                     if (n.x < 0)
-                        a += M_PI/8;
+                        a = acos(-n.x) -M_PI_2;
                     else
                         a += M_PI_2;
                 }
@@ -439,12 +439,12 @@ void vkvg_stroke_preserve (VkvgContext ctx)
 
             if (ctx->lineCap == VKVG_LINE_CAP_ROUND){
                 firstIdx = ctx->vertCount;
-                float step = M_PI_2 / hw;
+                float step = M_PI_4 / hw;
                 float a = acos(n.x)+ M_PI_2;
                 if (n.y < 0){
                     a = asin(n.y);
                     if (n.x < 0)
-                        a += M_PI/8;
+                        a = acos(-n.x) -M_PI_2;
                     else
                         a += M_PI_2;
                 }