Fix problems with the list when you change font size

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13680 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-06-21 13:21:33 +00:00
parent 0baad43a93
commit 2d4ee368e3

View file

@ -212,6 +212,7 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
bool draw_cursor;
int i;
int lines;
static int last_lines[NB_SCREENS] = {0};
#ifdef HAVE_LCD_BITMAP
int item_offset;
int old_margin = display->getxmargin();
@ -221,6 +222,7 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
#ifdef HAVE_LCD_BITMAP
display->setfont(FONT_UI);
gui_textarea_update_nblines(display);
#endif
/* Speed up UI by drawing the changed contents only. */
if (gui_list == last_list_displayed[gui_list->display->screen_type]
@ -230,10 +232,12 @@ static void gui_list_draw_smart(struct gui_list *gui_list)
partial_draw = true;
}
if (SHOW_LIST_TITLE)
lines = display->nb_lines - 1;
else
lines = display->nb_lines;
lines = display->nb_lines - SHOW_LIST_TITLE;
if (last_lines[display->screen_type] != lines)
{
gui_list_select_at_offset(gui_list, 0);
last_lines[display->screen_type] = lines;
}
if (partial_draw)
{