File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,6 +169,9 @@ void NVGSurface::updateWindowContextVisibility()
169169
170170 isRenderingThroughImage = renderThroughImage;
171171
172+ // Render a frame to the new target before showing/hiding GPU context
173+ renderAll ();
174+
172175#ifdef NANOVG_GL_IMPLEMENTATION
173176 if (glContext)
174177 glContext->setVisible (!renderThroughImage);
@@ -177,7 +180,7 @@ void NVGSurface::updateWindowContextVisibility()
177180 OSUtils::MTLSetVisible (view, !renderThroughImage);
178181 }
179182#endif
180-
183+
181184 invalidateAll ();
182185}
183186
@@ -476,7 +479,7 @@ void NVGSurface::setRenderThroughImage(bool const shouldRenderThroughImage)
476479{
477480 renderThroughImage = shouldRenderThroughImage;
478481 backupImageComponent.setVisible (shouldRenderThroughImage);
479- if (renderThroughImage) updateWindowContextVisibility ();
482+ // if(renderThroughImage) updateWindowContextVisibility();
480483}
481484
482485NVGSurface* NVGSurface::getSurfaceForContext (NVGcontext* nvg)
You can’t perform that action at this time.
0 commit comments