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

Function nsvg__parseLine

rEFIt_UEFI/libeg/nanosvg.cpp:3028–3049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3026}
3027
3028static void nsvg__parseLine(NSVGparser* p, const char** attr)
3029{
3030 float x1 = 0.0;
3031 float y1 = 0.0;
3032 float x2 = 0.0;
3033 float y2 = 0.0;
3034 int i;
3035
3036 for (i = 0; attr[i]; i += 2) {
3037 if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) {
3038 if (strcmp(attr[i], "x1") == 0) x1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p));
3039 else if (strcmp(attr[i], "y1") == 0) y1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p));
3040 else if (strcmp(attr[i], "x2") == 0) x2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p));
3041 else if (strcmp(attr[i], "y2") == 0) y2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p));
3042 }
3043 }
3044 nsvg__resetPath(p);
3045 nsvg__moveTo(p, x1, y1);
3046 nsvg__lineTo(p, x2, y2);
3047 nsvg__addPath(p, 0);
3048 nsvg__addShape(p);
3049}
3050
3051static void nsvg__parsePoly(NSVGparser* p, const char** attr, int closeFlag)
3052{

Callers 1

nsvg__startElementFunction · 0.85

Calls 12

nsvg__parseAttrFunction · 0.85
nsvg__parseCoordinateFunction · 0.85
nsvg__actualOrigXFunction · 0.85
nsvg__actualWidthFunction · 0.85
nsvg__actualOrigYFunction · 0.85
nsvg__actualHeightFunction · 0.85
nsvg__resetPathFunction · 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