From 47c15e9dabf887a83186acf98213316fe5f807c5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 16 Jun 2023 22:51:21 +0300 Subject: SL-19795 Slight gallery scroll improvement use scroll's rect instead of gallery's rect --- indra/newview/llinventorygallery.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') 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; -- cgit v1.2.3