summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2009-11-25 10:49:49 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2009-11-25 10:49:49 +0000
commit664b848bac30a7f3f1177a683e0913c9457dc041 (patch)
treeb284602f6911e31d5ef687e1c06b343ef83627e1 /indra/newview/llviewerwindow.cpp
parent6f4099e413d41ba56a5a339122050122363ca952 (diff)
parent41eb231e6a41da13549e5cbd4cfe6f5efeab74b1 (diff)
merge from trunk.
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index db66faef81..e30c8ab346 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()
@@ -1573,7 +1574,8 @@ void LLViewerWindow::initWorldUI()
LLPanel* side_tray_container = getRootView()->getChild<LLPanel>("side_tray_container");
LLSideTray* sidetrayp = LLSideTray::getInstance();
sidetrayp->setShape(side_tray_container->getLocalRect());
- sidetrayp->setFollowsAll();
+ // don't follow right edge to avoid spurious resizes, since we are using a fixed width layout
+ sidetrayp->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_BOTTOM);
side_tray_container->addChild(sidetrayp);
side_tray_container->setVisible(FALSE);
@@ -2867,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);
}
}
@@ -4752,7 +4752,6 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const
}
else
{
- llinfos << "World aspect ratio: " << world_aspect << llendl;
return world_aspect;
}
}
@@ -4794,6 +4793,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;