Fix for issue #23

- fix conversion of ndiv to int so that right number of iterations are
done.
This commit is contained in:
Mikko Mononen 2015-01-09 21:33:03 +02:00
parent fbc6c549c6
commit 767072b07a

View File

@ -1887,7 +1887,8 @@ static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args,
t[4] = cx; t[5] = cy;
// Split arc into max 90 degree segments.
ndivs = (int)(fabsf(da) / (NSVG_PI*0.5f) + 0.5f);
// The loop assumes an iteration per end point (including start and end), this +1.
ndivs = (int)(fabsf(da) / (NSVG_PI*0.5f) + 1.0f);
hda = (da / (float)ndivs) / 2.0f;
kappa = fabsf(4.0f / 3.0f * (1.0f - cosf(hda)) / sinf(hda));
if (da < 0.0f)