GUI: If GraphicsWidget is hidden do not proceed with GraphicsWidget::setGfx()

Removes interfering invisible thumbnail with list item selection in saveload-dialog (OpenGL, large scale)

I'm issuing this as a PR because I'm unsure if this fix is ok, since it affects all GraphicsWidget objects, not just the one for thumbnail in saveload-dialog. Also not sure if some similar check should be done in the other setGfx() methods in widget.cpp to prevent similar issues.
Note that an alternative fix, which also works, would be to only modify gui/saveload-dialog.cpp and method SaveLoadChooserSimple::updateSelection(), to check for _gfxWidget isVisible status before calling: _gfxWidget->setGfx(thumb, true);
This commit is contained in:
antoniou79 2021-06-20 13:12:46 +03:00 committed by Eugene Sandulenko
parent 89ae8da5de
commit 6fb05fceeb

View File

@ -880,6 +880,9 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
return;
}
if (!isVisible())
return;
float sf = g_gui.getScaleFactor();
if (scale && sf != 1.0) {
_w = gfx->w * sf;