diff options
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r-- | indra/llui/llui.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 2e9188a6a8..e9f8ba020e 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -236,11 +236,14 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { - F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); S32 screen_x, screen_y; - screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / dev_scale_factor); - screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / dev_scale_factor); - +#if defined(LL_DARWIN) + screen_x = ll_round((F32)x); + screen_y = ll_round((F32)y); +#else + screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); + screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); +#endif LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -248,11 +251,10 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; - F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = ll_round(((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]) * dev_scale_factor); - *y = ll_round(((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]) * dev_scale_factor); + *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); + *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VY]); } //static |