summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llinventorygallery.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 40c76a4b5f..200a9b2a91 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -342,12 +342,15 @@ void LLInventoryGallery::onVisibilityChange(BOOL new_visibility)
bool LLInventoryGallery::updateRowsIfNeeded()
{
- if(((getRect().getWidth() - mRowPanelWidth) > mItemWidth) && mRowCount > 1)
+ S32 scroll_content_width = mScrollPanel ? mScrollPanel->getVisibleContentRect().getWidth() : getRect().getWidth();
+ if(((scroll_content_width - mRowPanelWidth) > mItemWidth)
+ && mRowCount > 1)
{
reArrangeRows(1);
return true;
}
- else if((mRowPanelWidth > (getRect().getWidth() + mItemHorizontalGap)) && mItemsInRow > GALLERY_ITEMS_PER_ROW_MIN)
+ else if((mRowPanelWidth > (scroll_content_width + mItemHorizontalGap))
+ && mItemsInRow > GALLERY_ITEMS_PER_ROW_MIN)
{
reArrangeRows(-1);
return true;