diff options
author | X-Ryl669 <boite.pour.spam@gmail.com> | 2017-06-01 12:35:03 +0300 |
---|---|---|
committer | X-Ryl669 <boite.pour.spam@gmail.com> | 2017-06-01 12:35:03 +0300 |
commit | 7a9b4005c0de63d39753fdc0d81fea3f6a170255 (patch) | |
tree | 389dc1d95b70f26823cefd3abbef16cfb1b0cba5 /src | |
parent | 226e370e1d1aa080f0bbb8f2985b8f840753e129 (diff) |
Fix for wrong computation in ArcTo function
Diffstat (limited to 'src')
-rw-r--r-- | src/nanosvg.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/nanosvg.h b/src/nanosvg.h index 8a4b6fa..5c3e86d 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -2079,13 +2079,10 @@ static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args, // if (vecrat(ux,uy,vx,vy) <= -1.0f) da = NSVG_PI; // if (vecrat(ux,uy,vx,vy) >= 1.0f) da = 0; - if (fa) { - // Choose large arc - if (da > 0.0f) - da = da - 2*NSVG_PI; - else - da = 2*NSVG_PI + da; - } + if (fs == 0 && da > 0) + da -= 2 * NSVG_PI; + else if (fs == 1 && da < 0) + da += 2 * NSVG_PI; // Approximate the arc using cubic spline segments. t[0] = cosrx; t[1] = sinrx; |