summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llmanipscale.cpp5
-rw-r--r--indra/newview/llmaniptranslate.cpp10
-rw-r--r--indra/newview/llviewerwindow.h3
3 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 72596e850a..aa385b43a1 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -493,8 +493,9 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mProjectedManipulators.insert(projManipulator);
}
- F32 half_width = (F32)gViewerWindow->getWorldViewWidth() / 2.f;
- F32 half_height = (F32)gViewerWindow->getWorldViewHeight() / 2.f;
+ LLRect world_view_rect = gViewerWindow->getVirtualWorldViewRect();
+ F32 half_width = (F32)world_view_rect.getWidth() / 2.f;
+ F32 half_height = (F32)world_view_rect.getHeight() / 2.f;
LLVector2 manip2d;
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 delta;
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index f1b3a37677..002b8350f7 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -413,8 +413,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
}
// Handle auto-rotation if necessary.
+ LLRect world_rect = gViewerWindow->getVirtualWorldViewRect();
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
- const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidth() / 20;
+ const S32 ROTATE_H_MARGIN = world_rect.getWidth() / 20;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
BOOL rotated = FALSE;
@@ -426,7 +427,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
gAgent.cameraOrbitAround(rotate_angle);
rotated = TRUE;
}
- else if (x > gViewerWindow->getWorldViewWidth() - ROTATE_H_MARGIN)
+ else if (x > world_rect.getWidth() - ROTATE_H_MARGIN)
{
gAgent.cameraOrbitAround(-rotate_angle);
rotated = TRUE;
@@ -960,8 +961,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector2 manip_start_2d;
LLVector2 manip_end_2d;
LLVector2 manip_dir;
- F32 half_width = gViewerWindow->getWorldViewWidth() / 2.f;
- F32 half_height = gViewerWindow->getWorldViewHeight() / 2.f;
+ LLRect world_view_rect = gViewerWindow->getVirtualWorldViewRect();
+ F32 half_width = (F32)world_view_rect.getWidth() / 2.f;
+ F32 half_height = (F32)world_view_rect.getHeight() / 2.f;
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 mouse_delta;
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index c2906b1718..b7f2b91c52 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -212,8 +212,9 @@ public:
// Window in raw pixels as seen on screen.
const LLRect& getWindowRect() const { return mWindowRect; };
- // portion of window that shows 3d world
+ // portion of window that shows 3d world, in raw unscaled pixels
const LLRect& getWorldViewRect() const { return mWorldViewRect; };
+ // Use this rect for most UI computations, it accounts for UI size scaling
LLRect getVirtualWorldViewRect() const;
S32 getWorldViewHeight() const;
S32 getWorldViewWidth() const;