Skip to content

Commit 3bc4b4c

Browse files
committed
Fix by fvogel for DOS (Tk Ticket ea665e08f3)
1 parent 95f0e4e commit 3bc4b4c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

generic/nanosvg.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,25 +1670,32 @@ static int nsvg__parseRotate(float* xform, const char* str)
16701670
static void nsvg__parseTransform(float* xform, const char* str)
16711671
{
16721672
float t[6];
1673+
int len;
16731674
nsvg__xformIdentity(xform);
16741675
while (*str)
16751676
{
16761677
if (strncmp(str, "matrix", 6) == 0)
1677-
str += nsvg__parseMatrix(t, str);
1678+
len = nsvg__parseMatrix(t, str);
16781679
else if (strncmp(str, "translate", 9) == 0)
1679-
str += nsvg__parseTranslate(t, str);
1680+
len = nsvg__parseTranslate(t, str);
16801681
else if (strncmp(str, "scale", 5) == 0)
1681-
str += nsvg__parseScale(t, str);
1682+
len = nsvg__parseScale(t, str);
16821683
else if (strncmp(str, "rotate", 6) == 0)
1683-
str += nsvg__parseRotate(t, str);
1684+
len = nsvg__parseRotate(t, str);
16841685
else if (strncmp(str, "skewX", 5) == 0)
1685-
str += nsvg__parseSkewX(t, str);
1686+
len = nsvg__parseSkewX(t, str);
16861687
else if (strncmp(str, "skewY", 5) == 0)
1687-
str += nsvg__parseSkewY(t, str);
1688+
len = nsvg__parseSkewY(t, str);
16881689
else{
16891690
++str;
16901691
continue;
16911692
}
1693+
if (len != 0) {
1694+
str += len;
1695+
} else {
1696+
++str;
1697+
continue;
1698+
}
16921699

16931700
nsvg__xformPremultiply(xform, t);
16941701
}

0 commit comments

Comments
 (0)