summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp3
-rw-r--r--indra/llui/llui.cpp10
2 files changed, 8 insertions, 5 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 0d42f726fa..752d4a27e6 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3260,7 +3260,8 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
menu->arrangeAndClear();
LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
- LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y);
+ F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor();
+ LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x/dev_scale_factor, mouse_y/dev_scale_factor);
const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect();
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 770f13c1c3..2e9188a6a8 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -236,9 +236,10 @@ 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]);
- screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
+ screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / dev_scale_factor);
+ screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / dev_scale_factor);
LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
}
@@ -247,10 +248,11 @@ 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]);
- *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
+ *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);
}
//static