diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7f6b30bd373bca3c84f506a1761b156796425eb2..b02b77ffbd8481526d8a7d1519d6232650f02ce5 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1317,9 +1317,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] * scale_factor; - to->mY = mouse_point[1] * scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } @@ -1337,9 +1336,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) convertWindowToScreen(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] / scale_factor; - to->mY = mouse_point[1] / scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 36fbd12e92affddf68489fe5ad5a95aefae5ac2f..024d965c6d9d1b0d334d5a9044ed252fd4d08267 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3016,12 +3016,13 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; + F32 scale_factor = mWindow->getDeviceScaleFactor(); + LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); - - LLUI::setMousePositionScreen(x, y); + mCurrentMouseDelta.set(0,0); } }