diff options
author | Debi King (Dessie) <dessie@lindenlab.com> | 2011-04-07 17:36:17 -0400 |
---|---|---|
committer | Debi King (Dessie) <dessie@lindenlab.com> | 2011-04-07 17:36:17 -0400 |
commit | e5055178db894eb79ce9f438338da04e5b4c2d7e (patch) | |
tree | fa445e94beb32566cecfd50af3a139f221145558 /indra/llui/llmenugl.cpp | |
parent | 2c5b7cf2f7528a7502f4fe3f9c6dec9217f8ae60 (diff) | |
parent | 1a2cc89cc59d92e768e109a1a822bfedfd9aaf01 (diff) |
Merged .hgtags from viewer-pre-release repo
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-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; } |