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

pull/3062/head
Andrei Kortunov 4 years ago
parent c989fac67b
commit 903b89a0ff

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

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

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

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

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

Loading…
Cancel
Save