Fix for wrong computation in ArcTo function

This commit is contained in:
X-Ryl669 2017-06-01 11:35:03 +02:00
parent 226e370e1d
commit 7a9b4005c0

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;