diff options
author | Merov Linden <merov@lindenlab.com> | 2011-03-23 15:28:03 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-03-23 15:28:03 -0700 |
commit | 17186d6dc1ef8893e15ffcee0b8a8a2afe70febc (patch) | |
tree | 649d5d1bf615474ed29e5f04c13ade9786716f8c /indra/llui | |
parent | cb1c85261e768c9653ed40bf6160e7cc7ca9ce74 (diff) | |
parent | 1c375a8c880354432da2b218c321ed708497e161 (diff) |
Pull from lindenlab/viewer-development
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llmenugl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 32d7be377a..f0374de98f 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1936,9 +1936,15 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction) { item_list_t::reverse_iterator first_visible_item_iter = mItems.rend(); + // Need to scroll through number of actual existing items in menu. + // Otherwise viewer will hang for a time needed to scroll U32_MAX + // times in std::advance(). STORM-659. + size_t nitems = mItems.size(); + U32 scrollable_items = nitems < mMaxScrollableItems ? nitems : mMaxScrollableItems; + // Advance by mMaxScrollableItems back from the end of the list // to make the last item visible. - std::advance(first_visible_item_iter, mMaxScrollableItems); + std::advance(first_visible_item_iter, scrollable_items); mFirstVisibleItem = *first_visible_item_iter; break; } |