GUI: Fix regression in PictureWidget which led to double scaling

This commit is contained in:
Eugene Sandulenko 2021-04-17 18:44:47 +02:00
parent 91832bf9d8
commit 9bcffc97ee
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -881,8 +881,13 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
}
float sf = g_gui.getScaleFactor();
if ((scale && sf != 1.0) || ((_w != gfx->w || _h != gfx->h) && _w && _h)) {
Graphics::Surface *tmp2 = gfx->rawSurface().scale(gfx->w * sf, gfx->h * sf, false);
if (scale && sf != 1.0) {
_w = gfx->w * sf;
_h = gfx->h * sf;
}
if ((_w != gfx->w || _h != gfx->h) && _w && _h) {
Graphics::Surface *tmp2 = gfx->rawSurface().scale(_w, _h, false);
_gfx.copyFrom(*tmp2);
tmp2->free();
delete tmp2;