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:
parent
025f50a2df
commit
b374255447
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user