summaryrefslogtreecommitdiff
path: root/indra/llui/llscrollcontainer.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-01-24 16:21:34 -0500
committerOz Linden <oz@lindenlab.com>2012-01-24 16:21:34 -0500
commitb2f77bee7ea98f5a4ff59e00095b5b3aff11e35b (patch)
tree7695bb632502f24325f7044c69e30946e767abce /indra/llui/llscrollcontainer.cpp
parent79f1cd0a73bd86ff545ad78b9b1878e350d77416 (diff)
parentea6cbc7b6b1de051a9bb1c311c4399a2b4d42cb3 (diff)
merge changes for vmrg-217
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