| 3049 | } |
| 3050 | |
| 3051 | static void nsvg__parsePoly(NSVGparser* p, const char** attr, int closeFlag) |
| 3052 | { |
| 3053 | int i; |
| 3054 | const char* s; |
| 3055 | float args[2]; |
| 3056 | int nargs, npts = 0; |
| 3057 | char item[64]; |
| 3058 | |
| 3059 | nsvg__resetPath(p); |
| 3060 | |
| 3061 | for (i = 0; attr[i]; i += 2) { |
| 3062 | if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { |
| 3063 | if (strcmp(attr[i], "points") == 0) { |
| 3064 | s = attr[i + 1]; |
| 3065 | nargs = 0; |
| 3066 | while (*s) { |
| 3067 | s = nsvg__getNextPathItem(s, item); |
| 3068 | args[nargs++] = (float)nsvg__atof(item); |
| 3069 | if (nargs >= 2) { |
| 3070 | if (npts == 0) |
| 3071 | nsvg__moveTo(p, args[0], args[1]); |
| 3072 | else |
| 3073 | nsvg__lineTo(p, args[0], args[1]); |
| 3074 | nargs = 0; |
| 3075 | npts++; |
| 3076 | } |
| 3077 | } |
| 3078 | } |
| 3079 | } |
| 3080 | } |
| 3081 | |
| 3082 | nsvg__addPath(p, (char)closeFlag); |
| 3083 | |
| 3084 | nsvg__addShape(p); |
| 3085 | } |
| 3086 | |
| 3087 | /* Slice - I dont know what it should be |
| 3088 | static void nsvg__parseIMAGE(NSVGparser* p, const char** attr) |
no test coverage detected