GUI: Fix scale sync for GraphicsWidget

This commit is contained in:
Eugene Sandulenko 2021-04-18 02:42:31 +02:00
parent d2d4f8e23a
commit c0f33c73f0
No known key found for this signature in database
GPG key ID: 014D387312D34F08

View file

@ -884,6 +884,9 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
if (scale && sf != 1.0) {
_w = gfx->w * sf;
_h = gfx->h * sf;
} else {
_w = gfx->w;
_h = gfx->h;
}
if ((_w != gfx->w || _h != gfx->h) && _w && _h) {
@ -916,7 +919,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
void GraphicsWidget::setGfxFromTheme(const char *name) {
const Graphics::ManagedSurface *gfx = g_gui.theme()->getImageSurface(name);
setGfx(gfx);
setGfx(gfx, false);
}
void GraphicsWidget::drawWidget() {