Fix stray pixels showing up when panning and moving a windows

This commit is contained in:
ζeh Matt committed 2025-04-25 17:48:39 +03:00
1 parent 12063aa884
commit e2d9a44a5d
1 file changed
+5 -1
@@ -361,16 +361,20 @@ public:
void PaintWindows() override
{
WindowResetVisibilities();
WindowUpdateAllViewports();
if (ClimateIsRaining() || ClimateIsSnowing() || ClimateIsSnowingHeavily())
{
WindowUpdateAllViewports();
// OpenGL doesn't support restoring pixels, always redraw.
// TODO: Render the weather to a texture and use that instead.
WindowDrawAll(_bitsDPI, 0, 0, static_cast<int32_t>(_width), static_cast<int32_t>(_height));
}
else
{
// Redraw dirty regions before updating the viewports, otherwise
// when viewports get panned, they copy dirty pixels
DrawAllDirtyBlocks();
WindowUpdateAllViewports();
DrawAllDirtyBlocks();
}
}