mirror of https://github.com/fltk/fltk
Upgrade bundled nanosvg library to latest upstream commit
commit 706eb0618249507c1700cef4a518f73e546b1c38 (upstream/master) Author: Mikko Mononen <memononen@gmail.com> Date: Wed Nov 22 22:47:18 2023 +0200 Merge pull request #249 from wcout/issue_240 Fix for #240: Bug: "else" missing + FLTK specific extensions, see documentation/src/bundled-libs.dox
This commit is contained in:
parent
973d53bbcd
commit
384b546dc6
|
@ -27,7 +27,7 @@ Current versions of bundled libraries (as of November 29, 2023):
|
||||||
Library Version/git commit Release date FLTK Version
|
Library Version/git commit Release date FLTK Version
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
jpeg jpeg-9e 2022-01-16 1.4.0
|
jpeg jpeg-9e 2022-01-16 1.4.0
|
||||||
nanosvg abcd277ea4 [1] 2022-12-22 1.4.0
|
nanosvg 7aeda550a8 [1] 2023-12-02 1.4.0
|
||||||
png libpng-1.6.40 2023-06-21 1.4.0
|
png libpng-1.6.40 2023-06-21 1.4.0
|
||||||
zlib zlib-1.3 2023-08-18 1.4.0
|
zlib zlib-1.3 2023-08-18 1.4.0
|
||||||
libdecor 060fe761 [2] 2023-12-01 1.4.0
|
libdecor 060fe761 [2] 2023-12-01 1.4.0
|
||||||
|
|
|
@ -346,6 +346,7 @@ static float nsvg__normalize(float *x, float* y)
|
||||||
}
|
}
|
||||||
|
|
||||||
static float nsvg__absf(float x) { return x < 0 ? -x : x; }
|
static float nsvg__absf(float x) { return x < 0 ? -x : x; }
|
||||||
|
static float nsvg__roundf(float x) { return (x >= 0) ? floorf(x + 0.5) : ceilf(x - 0.5); }
|
||||||
|
|
||||||
static void nsvg__flattenCubicBez(NSVGrasterizer* r,
|
static void nsvg__flattenCubicBez(NSVGrasterizer* r,
|
||||||
float x1, float y1, float x2, float y2,
|
float x1, float y1, float x2, float y2,
|
||||||
|
@ -888,10 +889,10 @@ static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float sta
|
||||||
// STBTT_assert(e->y0 <= start_point);
|
// STBTT_assert(e->y0 <= start_point);
|
||||||
// round dx down to avoid going too far
|
// round dx down to avoid going too far
|
||||||
if (dxdy < 0)
|
if (dxdy < 0)
|
||||||
z->dx = (int)(-floorf(NSVG__FIX * -dxdy));
|
z->dx = (int)(-nsvg__roundf(NSVG__FIX * -dxdy));
|
||||||
else
|
else
|
||||||
z->dx = (int)floorf(NSVG__FIX * dxdy);
|
z->dx = (int)nsvg__roundf(NSVG__FIX * dxdy);
|
||||||
z->x = (int)floorf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));
|
z->x = (int)nsvg__roundf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));
|
||||||
// z->x -= off_x * FIX;
|
// z->x -= off_x * FIX;
|
||||||
z->ey = e->y1;
|
z->ey = e->y1;
|
||||||
z->next = 0;
|
z->next = 0;
|
||||||
|
@ -1298,7 +1299,7 @@ static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, float opac
|
||||||
if (grad->nstops == 0) {
|
if (grad->nstops == 0) {
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
cache->colors[i] = 0;
|
cache->colors[i] = 0;
|
||||||
} if (grad->nstops == 1) {
|
} else if (grad->nstops == 1) {
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity);
|
cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue