Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/gpencil/nanosvg/nanosvg.h
| Context not available. | |||||
| static int nsvg__isCoordinate(const char *s) | static int nsvg__isCoordinate(const char *s) | ||||
| { | { | ||||
| // optional sign | /* optional sign (Blender: or dot) */ | ||||
| if (*s == '-' || *s == '+') | while (*s == '-' || *s == '+' || *s == '.') | ||||
filedescriptor: Why does this need to be a `while` loop? I think `if` was correct here. | |||||
Done Inline ActionsTo remove -. if present. erik85: To remove `-.` if present. | |||||
| s++; | s++; | ||||
| // must have at least one digit | // must have at least one digit | ||||
| return nsvg__isdigit(*s); | return nsvg__isdigit(*s); | ||||
| Context not available. | |||||
| nargs = 0; | nargs = 0; | ||||
| while (*s) { | while (*s) { | ||||
| s = nsvg__getNextPathItem(s, item); | /* Blender: Special case for arc command's 4th and 5th arguments. */ | ||||
| if (*s && ELEM(cmd, 'a', 'A') && ELEM(nargs, 3, 4)) { | |||||
Done Inline ActionsIRC, you can use the preferred format: if (*s && (ELEM(cmd, 'a', 'A')) && (ELEM(nargs, 3, 4))) { antoniov: IRC, you can use the preferred format:
`if (*s && (ELEM(cmd, 'a', 'A')) && (ELEM(nargs, 3… | |||||
| while (*s && (nsvg__isspace(*s) || *s == ',')) { | |||||
| s++; | |||||
| } | |||||
| item[0] = s[0]; | |||||
| item[1] = '\0'; | |||||
| s++; | |||||
| } | |||||
| else { | |||||
| s = nsvg__getNextPathItem(s, item); | |||||
| } | |||||
| if (!*item) | if (!*item) | ||||
| break; | break; | ||||
| if (cmd != '\0' && nsvg__isCoordinate(item)) { | if (cmd != '\0' && nsvg__isCoordinate(item)) { | ||||
| Context not available. | |||||
Why does this need to be a while loop? I think if was correct here.