From c4a10e9a53bd8f55b63b28783fa3758c21f6a122 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 24 Nov 2009 13:28:14 +0200 Subject: fixed EXT-2684 "Notification toasts position is incorrect" --HG-- branch : product-engine --- indra/newview/llviewerwindow.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index db66faef81..3840f337d4 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() @@ -2867,19 +2868,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); } } @@ -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; -- cgit v1.3 From c9e153c182dae9472a2b87cddfec8c47b30b06b9 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 24 Nov 2009 23:14:29 -0600 Subject: Fix for stalls when resizing screen texture. --- indra/newview/llviewerwindow.cpp | 1 - indra/newview/pipeline.cpp | 2 -- 2 files changed, 3 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 29ce2510f2..7873b4061e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4731,7 +4731,6 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const } else { - llinfos << "World aspect ratio: " << world_aspect << llendl; return world_aspect; } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ba1732bc92..136a0a27aa 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -516,8 +516,6 @@ void LLPipeline::resizeScreenTexture() GLuint resY = gViewerWindow->getWorldViewHeight(); allocateScreenBuffer(resX,resY); - - llinfos << "RESIZED SCREEN TEXTURE: " << resX << "x" << resY << llendl; } } -- cgit v1.3