MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / nsvg__parsePoly

Function nsvg__parsePoly

rEFIt_UEFI/libeg/nanosvg.cpp:3051–3085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3049}
3050
3051static 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)

Callers 1

nsvg__startElementFunction · 0.85

Calls 9

nsvg__resetPathFunction · 0.85
nsvg__parseAttrFunction · 0.85
nsvg__getNextPathItemFunction · 0.85
nsvg__atofFunction · 0.85
nsvg__moveToFunction · 0.85
nsvg__lineToFunction · 0.85
nsvg__addPathFunction · 0.85
nsvg__addShapeFunction · 0.85
strcmpFunction · 0.50

Tested by

no test coverage detected