diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-06 10:25:10 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-06 10:25:10 +0300 |
commit | 2d416222f80a02927fa454842dbb0523b784119e (patch) | |
tree | 7ed915fe57428d5df0899560d5a81b0695184eb5 /indra/newview/llviewerwindow.cpp | |
parent | 8f931a4768df909050f9f8609c8e74d977e38026 (diff) | |
parent | 457df9cd6724c23fff9a88fb7db44b6b04a7769c (diff) |
Merged in lindenlab/viewer-bear
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a1edbf6add..51969a7091 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1763,12 +1763,19 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); + // Reset UI scale factor on first run if OS's display scaling is not 100% + if (gSavedSettings.getBOOL("FSResetUIScaleOnFirstRun")) + { + if (mWindow->getSystemUISize() != 1.f) + { + gSavedSettings.setF32("UIScaleFactor", 1.f); + } + gSavedSettings.setBOOL("ResetUIScaleOnFirstRun", FALSE); + } + // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); -#if LL_DARWIN - ui_scale_factor *= mWindow->getSystemUISize(); -#endif + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5341,11 +5348,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); -#if LL_DARWIN - ui_scale_factor *= mWindow->getSystemUISize(); -#endif - + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; |