mirror of
https://git.sr.ht/~calebccff/pbsplash
synced 2026-01-12 20:48:40 -09:00
nanosvg: fix some dodgy checks
This commit is contained in:
parent
0e626c1812
commit
a5af6e1a50
1 changed files with 2 additions and 2 deletions
|
|
@ -978,7 +978,7 @@ static void nsvg__addShape(NSVGparser* p)
|
||||||
shape->fillRule = attr->fillRule;
|
shape->fillRule = attr->fillRule;
|
||||||
shape->opacity = attr->opacity;
|
shape->opacity = attr->opacity;
|
||||||
|
|
||||||
if (p->unicodeFlag) {
|
if (p->unicodeFlag[0]) {
|
||||||
strcat(shape->unicode, p->unicodeFlag);
|
strcat(shape->unicode, p->unicodeFlag);
|
||||||
if (p->horizAdvFlag) {
|
if (p->horizAdvFlag) {
|
||||||
shape->horizAdvX = strtol(p->horizAdvFlag, &end, 10);
|
shape->horizAdvX = strtol(p->horizAdvFlag, &end, 10);
|
||||||
|
|
@ -2973,7 +2973,7 @@ NSVGshape** nsvgGetTextShapes(NSVGimage* image, char* text, int textLen)
|
||||||
for (shape = image->shapes; shape != NULL; shape = shape->next) {
|
for (shape = image->shapes; shape != NULL; shape = shape->next) {
|
||||||
if (!(shape->flags & NSVG_FLAGS_VISIBLE))
|
if (!(shape->flags & NSVG_FLAGS_VISIBLE))
|
||||||
continue;
|
continue;
|
||||||
if (shape->unicode && shape->unicode[0] == text[i]) {
|
if (shape->unicode[0] == text[i]) {
|
||||||
ret[i] = shape;
|
ret[i] = shape;
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue