1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Add bound for UI scale factor, as it specified in docs

This commit is contained in:
Andrei Kortunov 2021-04-10 11:21:53 +04:00
parent c989fac67b
commit 903b89a0ff
5 changed files with 6 additions and 5 deletions

View file

@ -71,7 +71,7 @@ namespace MWGui
, mUpdateTimer(0.f)
{
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale > 1.0)
if (uiScale > 0.f)
mScaleFactor = uiScale;
mPreviewTexture.reset(new osgMyGUI::OSGTexture(mPreview->getTexture()));

View file

@ -70,7 +70,7 @@ namespace MWInput
}
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale != 0.f)
if (uiScale > 0.f)
mInvUiScalingFactor = 1.f / uiScale;
float deadZoneRadius = Settings::Manager::getFloat("joystick dead zone", "Input");

View file

@ -37,7 +37,7 @@ namespace MWInput
, mGuiCursorEnabled(true)
{
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale != 0.f)
if (uiScale > 0.f)
mInvUiScalingFactor = 1.f / uiScale;
int w,h;

View file

@ -90,7 +90,7 @@ LocalMap::LocalMap(osg::Group* root)
{
// Increase map resolution, if use UI scaling
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale > 1.0)
if (uiScale > 0.f)
mMapResolution *= uiScale;
SceneUtil::FindByNameVisitor find("Scene Root");

View file

@ -569,6 +569,7 @@ namespace Gui
resolution = std::min(960, std::max(48, resolution));
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
if (uiScale > 0.f)
resolution *= uiScale;
MyGUI::xml::ElementPtr resolutionNode = resourceNode->createChild("Property");