|
@@ -610,7 +610,7 @@ static void nsvg__curveBounds(float* bounds, float* curve)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static NSVGparser* nsvg__createParser()
|
|
|
+static NSVGparser* nsvg__createParser(void)
|
|
|
{
|
|
|
NSVGparser* p;
|
|
|
p = (NSVGparser*)malloc(sizeof(NSVGparser));
|
|
@@ -1194,6 +1194,19 @@ static const char* nsvg__parseNumber(const char* s, char* it, const int size)
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
+static const char* nsvg__getNextPathItemWhenArcFlag(const char* s, char* it)
|
|
|
+{
|
|
|
+ it[0] = '\0';
|
|
|
+ while (*s && (nsvg__isspace(*s) || *s == ',')) s++;
|
|
|
+ if (!*s) return s;
|
|
|
+ if (*s == '0' || *s == '1') {
|
|
|
+ it[0] = *s++;
|
|
|
+ it[1] = '\0';
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+ return s;
|
|
|
+}
|
|
|
+
|
|
|
static const char* nsvg__getNextPathItem(const char* s, char* it)
|
|
|
{
|
|
|
it[0] = '\0';
|
|
@@ -2279,7 +2292,11 @@ static void nsvg__parsePath(NSVGparser* p, const char** attr)
|
|
|
nargs = 0;
|
|
|
|
|
|
while (*s) {
|
|
|
- s = nsvg__getNextPathItem(s, item);
|
|
|
+ item[0] = '\0';
|
|
|
+ if ((cmd == 'A' || cmd == 'a') && (nargs == 3 || nargs == 4))
|
|
|
+ s = nsvg__getNextPathItemWhenArcFlag(s, item);
|
|
|
+ if (!*item)
|
|
|
+ s = nsvg__getNextPathItem(s, item);
|
|
|
if (!*item) break;
|
|
|
if (cmd != '\0' && nsvg__isCoordinate(item)) {
|
|
|
if (nargs < 10)
|