1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 09:19:41 +00:00

WindowBase::center use the layer size instead of render window size

This commit is contained in:
scrawl 2015-11-08 18:23:47 +01:00
parent f9932130da
commit a7ad45e73e

View file

@ -49,11 +49,13 @@ void WindowBase::center()
{
// Centre dialog
MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntSize layerSize = MyGUI::RenderManager::getInstance().getViewSize();
if (mMainWidget->getLayer())
layerSize = mMainWidget->getLayer()->getSize();
MyGUI::IntCoord coord = mMainWidget->getCoord();
coord.left = (gameWindowSize.width - coord.width)/2;
coord.top = (gameWindowSize.height - coord.height)/2;
coord.left = (layerSize.width - coord.width)/2;
coord.top = (layerSize.height - coord.height)/2;
mMainWidget->setCoord(coord);
}