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 = NSVG_PI;
// if (vecrat(ux,uy,vx,vy) >= 1.0f) da = 0; // if (vecrat(ux,uy,vx,vy) >= 1.0f) da = 0;
if (fa) { if (fs == 0 && da > 0)
// Choose large arc da -= 2 * NSVG_PI;
if (da > 0.0f) else if (fs == 1 && da < 0)
da = da - 2*NSVG_PI; da += 2 * NSVG_PI;
else
da = 2*NSVG_PI + da;
}
// Approximate the arc using cubic spline segments. // Approximate the arc using cubic spline segments.
t[0] = cosrx; t[1] = sinrx; t[0] = cosrx; t[1] = sinrx;