Skip to content

Commit 3fd6902

Browse files
author
alcomposer
committed
Make sure to generate quick canvas buffers if the are null
1 parent 9e369f0 commit 3fd6902

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/NVGSurface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ void NVGSurface::detachContext()
202202
void NVGSurface::updateBufferSize()
203203
{
204204
float pixelScale = getRenderScale();
205-
int scaledWidth = getWidth() * pixelScale + doubleCnvMargin;
206-
int scaledHeight = getHeight() * pixelScale + doubleCnvMargin;
205+
int scaledWidth = (getWidth() + doubleCnvMargin) * pixelScale;
206+
int scaledHeight = (getHeight() + doubleCnvMargin) * pixelScale;
207207

208-
if (fbWidth != scaledWidth || fbHeight != scaledHeight || !invalidFBO) {
208+
if (fbWidth != scaledWidth || fbHeight != scaledHeight || !invalidFBO || !quickCanvasFBO || !quickCanvasBlurFBO) {
209209
if (invalidFBO)
210210
nvgDeleteFramebuffer(invalidFBO);
211211
invalidFBO = nvgCreateFramebuffer(nvg, scaledWidth, scaledHeight, NVG_IMAGE_PREMULTIPLIED);

0 commit comments

Comments
 (0)