Skip to content

Commit fd96c44

Browse files
committed
Improve smoothness of dialog show/hide
1 parent afd5719 commit fd96c44

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Source/NVGSurface.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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

482485
NVGSurface* NVGSurface::getSurfaceForContext(NVGcontext* nvg)

0 commit comments

Comments
 (0)