summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-16 22:51:21 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-16 22:51:21 +0300
commit47c15e9dabf887a83186acf98213316fe5f807c5 (patch)
tree2101b3b16adb40234bc21e28db754632ea9604b1 /indra/newview/llinventorygallery.cpp
parentf608eafc3724899a16d01d4b9464a21f8fbc08d3 (diff)
SL-19795 Slight gallery scroll improvement
use scroll's rect instead of gallery's rect
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-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;