Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/memononen/nanosvg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorX-Ryl669 <boite.pour.spam@gmail.com>2017-06-01 12:35:03 +0300
committerX-Ryl669 <boite.pour.spam@gmail.com>2017-06-01 12:35:03 +0300
commit7a9b4005c0de63d39753fdc0d81fea3f6a170255 (patch)
tree389dc1d95b70f26823cefd3abbef16cfb1b0cba5 /src
parent226e370e1d1aa080f0bbb8f2985b8f840753e129 (diff)
Fix for wrong computation in ArcTo function
Diffstat (limited to 'src')
-rw-r--r--src/nanosvg.h11
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;