diff --git a/src/nanovg.c b/src/nanovg.c index 370dbf0..43371ec 100644 --- a/src/nanovg.c +++ b/src/nanovg.c @@ -295,7 +295,7 @@ void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float dev nvg__setDevicePixelRatio(ctx, devicePixelRatio); - ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight); + ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight, devicePixelRatio); ctx->drawCallCount = 0; ctx->fillTriCount = 0; diff --git a/src/nanovg.h b/src/nanovg.h index 870a04d..603b8e3 100644 --- a/src/nanovg.h +++ b/src/nanovg.h @@ -588,7 +588,7 @@ struct NVGparams { int (*renderDeleteTexture)(void* uptr, int image); int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data); int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h); - void (*renderViewport)(void* uptr, int width, int height); + void (*renderViewport)(void* uptr, int width, int height, float devicePixelRatio); void (*renderCancel)(void* uptr); void (*renderFlush)(void* uptr); void (*renderFill)(void* uptr, NVGpaint* paint, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths); diff --git a/src/nanovg_gl.h b/src/nanovg_gl.h index 4ba87f3..7580af1 100644 --- a/src/nanovg_gl.h +++ b/src/nanovg_gl.h @@ -941,7 +941,7 @@ static void glnvg__setUniforms(GLNVGcontext* gl, int uniformOffset, int image) } } -static void glnvg__renderViewport(void* uptr, int width, int height) +static void glnvg__renderViewport(void* uptr, int width, int height, float devicePixelRatio) { GLNVGcontext* gl = (GLNVGcontext*)uptr; gl->view[0] = (float)width;