Bugfix in svg import. Incorrect arc parsing if arc contains only one segment. (#2345)

This commit is contained in:
Calabaraburus 2018-12-19 07:34:02 +05:00 committed by shun-iwasawa
parent 63e288270b
commit 676b4b2f91

View file

@ -1285,7 +1285,7 @@ void nsvg__pathArcTo(struct NSVGParser *p, float *cpx, float *cpy, float *args,
t[5] = cy;
// Split arc into max 90 degree segments.
ndivs = (int)(fabsf(da) / (NSVG_PI * 0.5f) + 0.5f);
ndivs = (int)(ceil(fabsf(da)) / (NSVG_PI * 0.5f) + 0.5f);
hda = (da / (float)ndivs) / 2.0f;
kappa = fabsf(4.0f / 3.0f * (1.0f - cosf(hda)) / sinf(hda));
if (da < 0.0f) kappa = -kappa;