Skip to content
Myr

nanosvg: update to 93ce879dc4c04a3ef1758428ec80083c38610b1f

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent cfd74f4 · Browse files · 2 files+13 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−7 removed

  • other:+13 added−7 removed

2 files+13 added−7 removed

modified:3rd-party/nanosvg/src/nanosvgrast.h+9 added-7 removed
329 unmodified lines
330 return d;331}332333static float nsvg__absf(float x) { return x < 0 ? -x : x; }334static float nsvg__roundf(float x) { return (x >= 0) ? floorf(x + 0.5) : ceilf(x - 0.5); }335336static void nsvg__flattenCubicBez(NSVGrasterizer* r,337 float x1, float y1, float x2, float y2,338 float x3, float y3, float x4, float y4,
14 unmodified lines
353 y123 = (y12+y23)*0.5f;354355 dx = x4 - x1;356 dy = y4 - y1;356 d2 = nsvg__absf(((x2 - x4) * dy - (y2 - y4) * dx));357 d3 = nsvg__absf(((x3 - x4) * dy - (y3 - y4) * dx));357 d2 = nsvg__absf((x2 - x4) * dy - (y2 - y4) * dx);358 d3 = nsvg__absf((x3 - x4) * dy - (y3 - y4) * dx);359360 if ((d2 + d3)*(d2 + d3) < r->tessTol * (dx*dx + dy*dy)) {361 nsvg__addPathPoint(r, x4, y4, type);362 return;
509 unmodified lines
872 float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);873// STBTT_assert(e->y0 <= start_point);874 // round dx down to avoid going too far875 if (dxdy < 0)875 z->dx = (int)(-floorf(NSVG__FIX * -dxdy));876 z->dx = (int)(-nsvg__roundf(NSVG__FIX * -dxdy));877 else877 z->dx = (int)floorf(NSVG__FIX * dxdy);878 z->x = (int)floorf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));878 z->dx = (int)nsvg__roundf(NSVG__FIX * dxdy);879 z->x = (int)nsvg__roundf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));880// z->x -= off_x * FIX;881 z->ey = e->y1;882 z->next = 0;883 z->dir = e->dir;
398 unmodified lines
12821283 if (grad->nstops == 0) {1284 for (i = 0; i < 256; i++)1285 cache->colors[i] = 0;1285 } if (grad->nstops == 1) {1286 } else if (grad->nstops == 1) {1287 unsigned int color = nsvg__applyOpacity(grad->stops[0].color, opacity);1288 for (i = 0; i < 256; i++)1287 cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity);1289 cache->colors[i] = color;1290 } else {1291 unsigned int ca, cb = 0;1292 float ua, ub, du, u;1293 int ia, ib, count;
167 unmodified lines
modified:CHANGELOG.md+4 added
26 unmodified lines
272829## Unreleased30### Added3132* Nanosvg updated to 93ce879dc4c04a3ef1758428ec80083c38610b1f333435### Changed36### Deprecated37### Removed38### Fixed
656 unmodified lines