Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed building on Windows 64-bit
  • Loading branch information
slouken committed Feb 24, 2018
1 parent e63624f commit 6c8710f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nanosvgrast.h
Expand Up @@ -71,7 +71,9 @@ void nsvgDeleteRasterizer(NSVGrasterizer*);

#ifdef NANOSVGRAST_IMPLEMENTATION

/*
#include <math.h>
*/

#define NSVG__SUBSAMPLES 5
#define NSVG__FIXSHIFT 10
Expand Down Expand Up @@ -551,7 +553,7 @@ static void nsvg__roundJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right
if (da < NSVG_PI) da += NSVG_PI*2;
if (da > NSVG_PI) da -= NSVG_PI*2;

n = (int)ceilf((nsvg__absf(da) / NSVG_PI) * (float)ncap);
n = (int)SDL_ceilf((nsvg__absf(da) / NSVG_PI) * (float)ncap);
if (n < 2) n = 2;
if (n > ncap) n = ncap;

Expand Down Expand Up @@ -594,7 +596,7 @@ static void nsvg__straightJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* ri
static int nsvg__curveDivs(float r, float arc, float tol)
{
float da = acosf(r / (r + tol)) * 2.0f;
int divs = (int)ceilf(arc / da);
int divs = (int)SDL_ceilf(arc / da);
if (divs < 2) divs = 2;
return divs;
}
Expand Down Expand Up @@ -866,10 +868,10 @@ static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float sta
// STBTT_assert(e->y0 <= start_point);
// round dx down to avoid going too far
if (dxdy < 0)
z->dx = (int)(-floorf(NSVG__FIX * -dxdy));
z->dx = (int)(-SDL_floorf(NSVG__FIX * -dxdy));
else
z->dx = (int)floorf(NSVG__FIX * dxdy);
z->x = (int)floorf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));
z->dx = (int)SDL_floorf(NSVG__FIX * dxdy);
z->x = (int)SDL_floorf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0)));
// z->x -= off_x * FIX;
z->ey = e->y1;
z->next = 0;
Expand Down

0 comments on commit 6c8710f

Please sign in to comment.