| 3207 | } |
| 3208 | |
| 3209 | static void parsePattern(NSVGparser* p, const char** dict) |
| 3210 | { |
| 3211 | NSVGattrib* attr = nsvg__getAttr(p); |
| 3212 | int i; |
| 3213 | float w = 0.f, h=0.f; |
| 3214 | NSVGpattern *pt; |
| 3215 | |
| 3216 | for (i = 0; dict[i]; i += 2) { |
| 3217 | if (strcmp(dict[i], "width") == 0) { |
| 3218 | w = nsvg__parseCoordinate(p, dict[i+1], 0.0f, nsvg__actualWidth(p)); |
| 3219 | } else if (strcmp(dict[i], "height") == 0) { |
| 3220 | h = nsvg__parseCoordinate(p, dict[i+1], 0.0f, nsvg__actualHeight(p)); |
| 3221 | } else { |
| 3222 | nsvg__parseAttr(p, dict[i], dict[i + 1]); |
| 3223 | } |
| 3224 | } |
| 3225 | |
| 3226 | pt = (__typeof__(pt))AllocateZeroPool(sizeof(NSVGpattern)); |
| 3227 | AsciiStrCpyS(pt->id, 64, attr->id); |
| 3228 | pt->width = w; |
| 3229 | pt->height = h; |
| 3230 | pt->next = p->patterns; |
| 3231 | p->patterns = pt; |
| 3232 | } |
| 3233 | |
| 3234 | static void nsvg__parseSVG(NSVGparser* p, const char** attr) |
| 3235 | { |
no test coverage detected