1. simon_linden
  2. viewer-rabbit


Paul ProductEngine  committed bd3bb90

STORM-659 FIXED Viewer hangs when navigate in the Back/Fwd Teleport history by keyboard

If user didn't set number of max scrollable items (msi) then msi = U32_MAX

If user didn't set number of msi then number of scrollable items = number of items in menu.

  • Participants
  • Parent commits 344d4c6
  • Branches default

Comments (0)

Files changed (1)

File indra/llui/llmenugl.cpp

View file
 		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;