From 09686d684ec09c8f0e08970df45ff8387510ea04 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 20 Apr 2019 11:40:42 +0400 Subject: [PATCH] Update background texture if a new one is empty (regression #4986) --- apps/openmw/mwgui/itemwidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/itemwidget.cpp b/apps/openmw/mwgui/itemwidget.cpp index 1933795707..940e95a7e9 100644 --- a/apps/openmw/mwgui/itemwidget.cpp +++ b/apps/openmw/mwgui/itemwidget.cpp @@ -148,9 +148,9 @@ namespace MWGui if (backgroundTex != "") backgroundTex += ".dds"; + float scale = 1.f; if (!backgroundTex.empty()) { - float scale = 1.f; auto found = mScales.find(backgroundTex); if (found == mScales.end()) { @@ -165,13 +165,13 @@ namespace MWGui } else scale = found->second; - - if (state == Barter && !isMagic) - setFrame(backgroundTex, MyGUI::IntCoord(2*scale,2*scale,44*scale,44*scale)); - else - setFrame(backgroundTex, MyGUI::IntCoord(0,0,44*scale,44*scale)); } + if (state == Barter && !isMagic) + setFrame(backgroundTex, MyGUI::IntCoord(2*scale,2*scale,44*scale,44*scale)); + else + setFrame(backgroundTex, MyGUI::IntCoord(0,0,44*scale,44*scale)); + setIcon(ptr); }