+// Adjust variables relating to the scrolling of tags, for when a selected icon isn't
+// visible given the current scrolling condition....
+static VOID AdjustScrollState(/* IN REFIT_MENU_SCREEN *Screen, */ IN SCROLL_STATE *State) {
+ if (State->CurrentSelection > State->LastVisible) {
+ State->LastVisible = State->CurrentSelection;
+ State->FirstVisible = 1 + State->CurrentSelection - State->MaxVisible;
+ if (State->FirstVisible < 0) // shouldn't happen, but just in case....
+ State->FirstVisible = 0;
+ State->PaintAll = TRUE;
+ } // Scroll forward
+ if (State->CurrentSelection < State->FirstVisible) {
+ State->FirstVisible = State->CurrentSelection;
+ State->LastVisible = State->CurrentSelection + State->MaxVisible - 1;
+ State->PaintAll = TRUE;
+ } // Scroll backward
+} // static VOID AdjustScrollState
+