diff options
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7b6c125eb1..5dd4e2d0ee 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -835,6 +835,12 @@ void LLScrollListCtrl::updateLayout() mItemListRect.mRight = getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE; } + // don't allow scrolling off bottom + if (mScrollLines + mPageLines > getItemCount()) + { + setScrollPos(llmax(0, getItemCount() - mPageLines)); + } + mScrollbar->reshape(SCROLLBAR_SIZE, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0)); mScrollbar->setPageSize( mPageLines ); mScrollbar->setDocSize( getItemCount() ); @@ -2663,6 +2669,11 @@ void LLScrollListCtrl::scrollToShowSelected() return; } + if (needsSorting() && !isSorted()) + { + sortItems(); + } + S32 index = getFirstSelectedIndex(); if (index < 0) { |