summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorAnsariel Hiller <ansarielhiller@yahoo.de>2016-11-19 11:19:01 +0000
committerAnsariel Hiller <ansarielhiller@yahoo.de>2016-11-19 11:19:01 +0000
commit76b3efe01cdf96879c3e7880ee78cccafd36e917 (patch)
tree06167b0ae475a292a1cc8b131d3ffd16ef92fbcb /indra/llwindow
parentb3493dcaeeb49ca503cb889cbe9e95a63f8eed56 (diff)
MAINT-6953 [Contribution] Error in DPI scaling calculation
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowwin32.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 4086db8e52..062f922006 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2623,7 +2623,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_DPICHANGED:
{
LPRECT lprc_new_scale;
- F32 new_scale = LOWORD(w_param) / USER_DEFAULT_SCREEN_DPI;
+ F32 new_scale = F32(LOWORD(w_param)) / F32(USER_DEFAULT_SCREEN_DPI);
lprc_new_scale = (LPRECT)l_param;
S32 new_width = lprc_new_scale->right - lprc_new_scale->left;
S32 new_height = lprc_new_scale->bottom - lprc_new_scale->top;
@@ -3982,7 +3982,7 @@ F32 LLWindowWin32::getSystemUISize()
hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy);
if (hr == S_OK)
{
- scale_value = dpix / USER_DEFAULT_SCREEN_DPI;
+ scale_value = F32(dpix) / F32(USER_DEFAULT_SCREEN_DPI);
}
else
{
@@ -4001,7 +4001,7 @@ F32 LLWindowWin32::getSystemUISize()
else
{
LL_WARNS() << "Could not load shcore.dll library (included by <ShellScalingAPI.h> from Win 8.1 SDK). Using legacy DPI awareness API of Win XP/7" << LL_ENDL;
- scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI;
+ scale_value = F32(GetDeviceCaps(hdc, LOGPIXELSX)) / F32(USER_DEFAULT_SCREEN_DPI);
}
ReleaseDC(hWnd, hdc);