Fix for issue #23
- fix conversion of ndiv to int so that right number of iterations are done.
This commit is contained in:
parent
fbc6c549c6
commit
767072b07a
@ -1887,7 +1887,8 @@ static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args,
|
|||||||
t[4] = cx; t[5] = cy;
|
t[4] = cx; t[5] = cy;
|
||||||
|
|
||||||
// Split arc into max 90 degree segments.
|
// 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;
|
hda = (da / (float)ndivs) / 2.0f;
|
||||||
kappa = fabsf(4.0f / 3.0f * (1.0f - cosf(hda)) / sinf(hda));
|
kappa = fabsf(4.0f / 3.0f * (1.0f - cosf(hda)) / sinf(hda));
|
||||||
if (da < 0.0f)
|
if (da < 0.0f)
|
||||||
|
Loading…
Reference in New Issue
Block a user