Merge pull request #89 from X-Ryl669/master

Fix for wrong computation in ArcTo function
This commit is contained in:
Mikko Mononen 2017-06-01 20:33:56 +03:00 committed by GitHub
commit 5ec585ce1a

View File

@ -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;