summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-11-24 12:42:14 -0800
committerSteve Bennetts <steve@lindenlab.com>2009-11-24 12:42:14 -0800
commit9e2d78aca1fa96e96b4b324cabfb0efeb26f7397 (patch)
tree042a161e9bc2608d0098b2ea745178384f466362 /indra/newview/llviewerwindow.cpp
parentf9081220accfe5c197f1c567af8806bde236f946 (diff)
parent04cf3fefca230f4f2c351dddebb36e691a9f7bc5 (diff)
Merge from product-engine
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 29d40d073c..3f53fae36c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1347,6 +1347,7 @@ LLViewerWindow::LLViewerWindow(
mDebugText = new LLDebugText(this);
+ mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale);
}
void LLViewerWindow::initGLDefaults()
@@ -2868,19 +2869,17 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
if (mWorldViewRectRaw != new_world_rect)
{
- // sending a signal with a new WorldView rect
- mOnWorldViewRectUpdated(mWorldViewRectRaw, new_world_rect);
-
+ LLRect old_world_rect = mWorldViewRectRaw;
mWorldViewRectRaw = new_world_rect;
gResizeScreenTexture = TRUE;
LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() );
LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() );
- mWorldViewRectScaled = mWorldViewRectRaw;
- mWorldViewRectScaled.mLeft = llround((F32)mWorldViewRectScaled.mLeft / mDisplayScale.mV[VX]);
- mWorldViewRectScaled.mRight = llround((F32)mWorldViewRectScaled.mRight / mDisplayScale.mV[VX]);
- mWorldViewRectScaled.mBottom = llround((F32)mWorldViewRectScaled.mBottom / mDisplayScale.mV[VY]);
- mWorldViewRectScaled.mTop = llround((F32)mWorldViewRectScaled.mTop / mDisplayScale.mV[VY]);
+ mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale);
+
+ // sending a signal with a new WorldView rect
+ old_world_rect = calcScaledRect(old_world_rect, mDisplayScale);
+ mOnWorldViewRectUpdated(old_world_rect, mWorldViewRectScaled);
}
}
@@ -4795,6 +4794,18 @@ void LLViewerWindow::calcDisplayScale()
}
}
+//static
+LLRect LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale)
+{
+ LLRect res = rect;
+ res.mLeft = llround((F32)res.mLeft / display_scale.mV[VX]);
+ res.mRight = llround((F32)res.mRight / display_scale.mV[VX]);
+ res.mBottom = llround((F32)res.mBottom / display_scale.mV[VY]);
+ res.mTop = llround((F32)res.mTop / display_scale.mV[VY]);
+
+ return res;
+}
+
S32 LLViewerWindow::getChatConsoleBottomPad()
{
S32 offset = 0;