mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-19 19:06:48 +00:00
WindowBase::center use the layer size instead of render window size
This commit is contained in:
parent
f9932130da
commit
a7ad45e73e
1 changed files with 5 additions and 3 deletions
|
@ -49,11 +49,13 @@ void WindowBase::center()
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// 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();
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
coord.left = (layerSize.width - coord.width)/2;
|
||||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
coord.top = (layerSize.height - coord.height)/2;
|
||||||
mMainWidget->setCoord(coord);
|
mMainWidget->setCoord(coord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue