X-Git-Url: https://code.delx.au/refind/blobdiff_plain/0e0eab46ae75565917f99a93f28589a351c000b7..fde5d6e97a5ec6c37eaa79ff05729d72b31133ef:/refind/menu.c diff --git a/refind/menu.c b/refind/menu.c index 2b63d05..ad8d39c 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -770,24 +770,30 @@ static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN // Move the selection to State->CurrentSelection, adjusting icon row if necessary... static VOID PaintSelection(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN *itemPosX, UINTN row0PosY, UINTN row1PosY, UINTN textPosY) { - UINTN XSelect, YPos; + UINTN XSelectPrev, XSelectCur, YPosPrev, YPosCur; - if ((State->CurrentSelection < State->LastVisible) && (State->CurrentSelection >= State->FirstVisible)) { + if (((State->CurrentSelection < State->LastVisible) && (State->CurrentSelection >= State->FirstVisible)) || + (State->CurrentSelection >= State->InitialRow1) ) { if (Screen->Entries[State->PreviousSelection]->Row == 0) { - XSelect = State->PreviousSelection - State->FirstVisible; - YPos = row0PosY; + XSelectPrev = State->PreviousSelection - State->FirstVisible; + YPosPrev = row0PosY; } else { - XSelect = State->PreviousSelection; - YPos = row1PosY; + XSelectPrev = State->PreviousSelection; + YPosPrev = row1PosY; } // if/else - DrawMainMenuEntry(Screen->Entries[State->PreviousSelection], FALSE, itemPosX[XSelect], YPos); - DrawMainMenuEntry(Screen->Entries[State->CurrentSelection], TRUE, - itemPosX[State->CurrentSelection - State->FirstVisible], - (Screen->Entries[State->CurrentSelection]->Row == 0) ? row0PosY : row1PosY); + if (Screen->Entries[State->CurrentSelection]->Row == 0) { + XSelectCur = State->CurrentSelection - State->FirstVisible; + YPosCur = row0PosY; + } else { + XSelectCur = State->CurrentSelection; + YPosCur = row1PosY; + } // if/else + DrawMainMenuEntry(Screen->Entries[State->PreviousSelection], FALSE, itemPosX[XSelectPrev], YPosPrev); + DrawMainMenuEntry(Screen->Entries[State->CurrentSelection], TRUE, itemPosX[XSelectCur], YPosCur); if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL)) DrawMainMenuText(Screen->Entries[State->CurrentSelection]->Title, (UGAWidth - LAYOUT_TEXT_WIDTH) >> 1, textPosY); - } else { + } else { // Current selection not visible; must redraw the menu.... MainMenuStyle(Screen, State, MENU_FUNCTION_PAINT_ALL, NULL); } } // static VOID MoveSelection(VOID)