Merge "recovery: fix UI error when directories too many [1/1]" into main am: a57eebae81

Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/2786283

Change-Id: I6699663cc3719523c93cb992bb3d4b0ff83fd32d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-10-27 10:04:03 +00:00 committed by Automerger Merge Worker
commit 42f35dbb26

View file

@ -181,7 +181,15 @@ int TextMenu::DrawItems(int x, int y, int screen_width, bool long_press) const {
if (!scrollable()) {
offset += draw_funcs_.DrawHorizontalRule(y + offset) + 4;
}
for (size_t i = MenuStart(); i < MenuEnd(); ++i) {
int items_block_height = gr_fb_height() - y - offset;;
int total = (char_height_ + 4) * (selection() + 1);;
int j = 0;
if (total > items_block_height) {
j = ((total - items_block_height) / (char_height_ + 4)) + 1;
}
for (size_t i = (MenuStart() + j); i < MenuEnd(); ++i) {
bool bold = false;
if (i == selection()) {
// Draw the highlight bar.