1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

Improve performance of moving spell window (don't recreate widgets unnecessarily)

This commit is contained in:
scrawl 2014-08-12 17:07:15 +02:00
parent 025f50a2df
commit b374255447
2 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,7 @@ namespace MWGui
, NoDrop(drag, mMainWidget)
, mHeight(0)
, mWidth(0)
, mWindowSize(mMainWidget->getSize())
{
mSpellIcons = new SpellIcons();
@ -308,7 +309,11 @@ namespace MWGui
void SpellWindow::onWindowResize(MyGUI::Window* _sender)
{
updateSpells();
if (mMainWidget->getSize() != mWindowSize)
{
mWindowSize = mMainWidget->getSize();
updateSpells();
}
}
void SpellWindow::onEnchantedItemSelected(MyGUI::Widget* _sender)

View File

@ -29,6 +29,8 @@ namespace MWGui
int mHeight;
int mWidth;
MyGUI::IntSize mWindowSize;
std::string mSpellToDelete;
void addGroup(const std::string& label, const std::string& label2);