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

Function nsvg__pathCubicBezShortTo

rEFIt_UEFI/libeg/nanosvg.cpp:2237–2265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2235}
2236
2237static void nsvg__pathCubicBezShortTo(NSVGparser* p, float* cpx, float* cpy,
2238 float* cpx2, float* cpy2, float* args, int rel)
2239{
2240 float x1, y1, x2, y2, cx1, cy1, cx2, cy2;
2241
2242 x1 = *cpx;
2243 y1 = *cpy;
2244 if (rel) {
2245 cx2 = *cpx + args[0];
2246 cy2 = *cpy + args[1];
2247 x2 = *cpx + args[2];
2248 y2 = *cpy + args[3];
2249 } else {
2250 cx2 = args[0];
2251 cy2 = args[1];
2252 x2 = args[2];
2253 y2 = args[3];
2254 }
2255
2256 cx1 = 2*x1 - *cpx2;
2257 cy1 = 2*y1 - *cpy2;
2258
2259 nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2);
2260
2261 *cpx2 = cx2;
2262 *cpy2 = cy2;
2263 *cpx = x2;
2264 *cpy = y2;
2265}
2266
2267static void nsvg__pathQuadBezTo(NSVGparser* p, float* cpx, float* cpy,
2268 float* cpx2, float* cpy2, float* args, int rel)

Callers 1

nsvg__parsePathFunction · 0.85

Calls 1

nsvg__cubicBezToFunction · 0.85

Tested by

no test coverage detected