summaryrefslogtreecommitdiff
path: root/indra/llui/llscrollcontainer.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-01-19 19:40:46 -0800
committerRichard Linden <none@none>2012-01-19 19:40:46 -0800
commita662b888ed02691b7790c23e31c7d8bcf7cf7f5b (patch)
tree09152b51229c0fdb1024526f9453402a801126f3 /indra/llui/llscrollcontainer.cpp
parent02641d4ef33fd6f296a9a29700ecdd55ef9dffd8 (diff)
EXP-1824 FIX Received Items panel does not collapse correct when Height of panel is maximized in Inventory window
Diffstat (limited to 'indra/llui/llscrollcontainer.cpp')
-rw-r--r--indra/llui/llscrollcontainer.cpp99
1 files changed, 51 insertions, 48 deletions
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index fe3f688fc5..ad4cc20d9a 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -424,63 +424,66 @@ void LLScrollContainer::draw()
focusFirstItem();
}
- // Draw background
- if( mIsOpaque )
+ if (getRect().isValid())
{
- F32 alpha = getCurrentTransparency();
+ // Draw background
+ if( mIsOpaque )
+ {
+ F32 alpha = getCurrentTransparency();
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha);
- }
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha);
+ }
- // Draw mScrolledViews and update scroll bars.
- // get a scissor region ready, and draw the scrolling view. The
- // scissor region ensures that we don't draw outside of the bounds
- // of the rectangle.
- if( mScrolledView )
- {
- updateScroll();
-
- // Draw the scrolled area.
+ // Draw mScrolledViews and update scroll bars.
+ // get a scissor region ready, and draw the scrolling view. The
+ // scissor region ensures that we don't draw outside of the bounds
+ // of the rectangle.
+ if( mScrolledView )
{
- S32 visible_width = 0;
- S32 visible_height = 0;
- BOOL show_v_scrollbar = FALSE;
- BOOL show_h_scrollbar = FALSE;
- calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
-
- LLLocalClipRect clip(LLRect(mInnerRect.mLeft,
- mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height,
- mInnerRect.mRight - (show_v_scrollbar ? scrollbar_size: 0),
- mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0)
- ));
- drawChild(mScrolledView);
- }
- }
-
- // Highlight border if a child of this container has keyboard focus
- if( mBorder->getVisible() )
- {
- mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) );
- }
+ updateScroll();
- // Draw all children except mScrolledView
- // Note: scrollbars have been adjusted by above drawing code
- for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin();
- child_iter != getChildList()->rend(); ++child_iter)
- {
- LLView *viewp = *child_iter;
- if( sDebugRects )
- {
- sDepth++;
+ // Draw the scrolled area.
+ {
+ S32 visible_width = 0;
+ S32 visible_height = 0;
+ BOOL show_v_scrollbar = FALSE;
+ BOOL show_h_scrollbar = FALSE;
+ calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
+
+ LLLocalClipRect clip(LLRect(mInnerRect.mLeft,
+ mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height,
+ mInnerRect.mRight - (show_v_scrollbar ? scrollbar_size: 0),
+ mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0)
+ ));
+ drawChild(mScrolledView);
+ }
}
- if( (viewp != mScrolledView) && viewp->getVisible() )
+
+ // Highlight border if a child of this container has keyboard focus
+ if( mBorder->getVisible() )
{
- drawChild(viewp);
+ mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) );
}
- if( sDebugRects )
+
+ // Draw all children except mScrolledView
+ // Note: scrollbars have been adjusted by above drawing code
+ for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin();
+ child_iter != getChildList()->rend(); ++child_iter)
{
- sDepth--;
+ LLView *viewp = *child_iter;
+ if( sDebugRects )
+ {
+ sDepth++;
+ }
+ if( (viewp != mScrolledView) && viewp->getVisible() )
+ {
+ drawChild(viewp);
+ }
+ if( sDebugRects )
+ {
+ sDepth--;
+ }
}
}
} // end draw