mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-27 23:37:20 +00:00
Do not take in account UI scaling factor twice
This commit is contained in:
parent
2438fb4c98
commit
d10b0d503b
@ -7,7 +7,6 @@
|
|||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include <components/settings/values.hpp>
|
|
||||||
#include <components/widgets/imagebutton.hpp>
|
#include <components/widgets/imagebutton.hpp>
|
||||||
|
|
||||||
#include "draganddrop.hpp"
|
#include "draganddrop.hpp"
|
||||||
@ -80,12 +79,12 @@ void WindowBase::center()
|
|||||||
|
|
||||||
void WindowBase::clampWindowCoordinates(MyGUI::Window* window)
|
void WindowBase::clampWindowCoordinates(MyGUI::Window* window)
|
||||||
{
|
{
|
||||||
auto minSize = window->getMinSize();
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
minSize.height = static_cast<int>(minSize.height * Settings::gui().mScalingFactor);
|
if (window->getLayer())
|
||||||
minSize.width = static_cast<int>(minSize.width * Settings::gui().mScalingFactor);
|
viewSize = window->getLayer()->getSize();
|
||||||
|
|
||||||
// Window's minimum size is larger than the screen size, can not clamp coordinates
|
// Window's minimum size is larger than the screen size, can not clamp coordinates
|
||||||
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
auto minSize = window->getMinSize();
|
||||||
if (minSize.width > viewSize.width || minSize.height > viewSize.height)
|
if (minSize.width > viewSize.width || minSize.height > viewSize.height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user