Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 159a5473 authored by weifang.liu's avatar weifang.liu
Browse files

recovery: fix UI error when directories too many [1/1]



PD#SWPL-109807
PD#SWPL-140491
BUG=296817261

Problem:
UI error when directories too many

Solution:
check if select menu exceed screen size

Verify:
ohm

Change-Id: I4905a5766985aa5b9f59cd30613f4c90c07c16ab
Signed-off-by: default avatarXindong Xu <xindong.xu@amlogic.com>
parent d5a9337b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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.