Fixed bug in path number parsing in exponent form (i.e. 6e-5)
This commit is contained in:
parent
95daad571d
commit
87aed6d1fc
3
.gitignore
vendored
3
.gitignore
vendored
@ -24,5 +24,8 @@ Thumbs.db
|
|||||||
## Build dir
|
## Build dir
|
||||||
build/*
|
build/*
|
||||||
|
|
||||||
|
## Stuff in example
|
||||||
|
example/_*
|
||||||
|
|
||||||
## xcode specific
|
## xcode specific
|
||||||
*xcuserdata*
|
*xcuserdata*
|
||||||
|
@ -513,7 +513,6 @@ error:
|
|||||||
|
|
||||||
static void nsvg__addPath(struct NSVGParser* p, char closed)
|
static void nsvg__addPath(struct NSVGParser* p, char closed)
|
||||||
{
|
{
|
||||||
float* t = NULL;
|
|
||||||
struct NSVGAttrib* attr = nsvg__getAttr(p);
|
struct NSVGAttrib* attr = nsvg__getAttr(p);
|
||||||
struct NSVGpath* path = NULL;
|
struct NSVGpath* path = NULL;
|
||||||
int i;
|
int i;
|
||||||
@ -534,9 +533,8 @@ static void nsvg__addPath(struct NSVGParser* p, char closed)
|
|||||||
path->npts = p->npts;
|
path->npts = p->npts;
|
||||||
|
|
||||||
// Transform path.
|
// Transform path.
|
||||||
t = attr->xform;
|
|
||||||
for (i = 0; i < p->npts; ++i)
|
for (i = 0; i < p->npts; ++i)
|
||||||
nsvg__xformPoint(&path->pts[i*2], &path->pts[i*2+1], p->pts[i*2], p->pts[i*2+1], t);
|
nsvg__xformPoint(&path->pts[i*2], &path->pts[i*2+1], p->pts[i*2], p->pts[i*2+1], attr->xform);
|
||||||
|
|
||||||
path->next = p->plist;
|
path->next = p->plist;
|
||||||
p->plist = path;
|
p->plist = path;
|
||||||
@ -558,11 +556,7 @@ static const char* nsvg__getNextPathItem(const char* s, char* it)
|
|||||||
while (*s && (nsvg__isspace(*s) || *s == ',')) s++;
|
while (*s && (nsvg__isspace(*s) || *s == ',')) s++;
|
||||||
if (!*s) return s;
|
if (!*s) return s;
|
||||||
if (*s == '-' || *s == '+' || nsvg__isnum(*s)) {
|
if (*s == '-' || *s == '+' || nsvg__isnum(*s)) {
|
||||||
while (*s == '-' || *s == '+') {
|
while (*s && nsvg__isnum(*s)) {
|
||||||
if (i < 63) it[i++] = *s;
|
|
||||||
s++;
|
|
||||||
}
|
|
||||||
while (*s && *s != '-' && *s != '+' && nsvg__isnum(*s)) {
|
|
||||||
if (i < 63) it[i++] = *s;
|
if (i < 63) it[i++] = *s;
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user