Better fix for FS#12337. Use 0 to make the line height calculated from the font height, as before r30773.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30850 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2011-10-29 15:16:02 +00:00
parent 9fe029b12a
commit 93c6c79e8d
5 changed files with 6 additions and 5 deletions

View file

@ -1694,7 +1694,6 @@ static bool skin_load_fonts(struct wps_data *data)
/* finally, assign the font_id to the viewport */ /* finally, assign the font_id to the viewport */
vp->font = font->id; vp->font = font->id;
vp->line_height = font_get(vp->font)->height;
} }
data->font_ids = skin_buffer_alloc(font_count * sizeof(int)); data->font_ids = skin_buffer_alloc(font_count * sizeof(int));
if (!success || data->font_ids == NULL) if (!success || data->font_ids == NULL)

View file

@ -223,6 +223,8 @@ static bool is_theme_enabled(enum screen_type screen)
int viewport_get_nb_lines(const struct viewport *vp) int viewport_get_nb_lines(const struct viewport *vp)
{ {
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
if (!vp->line_height)
return vp->height/font_get(vp->font)->height;
return vp->height/vp->line_height; return vp->height/vp->line_height;
#else #else
(void)vp; (void)vp;
@ -318,7 +320,7 @@ void viewport_set_fullscreen(struct viewport *vp,
set_default_align_flags(vp); set_default_align_flags(vp);
#endif #endif
vp->font = global_status.font_id[screen]; vp->font = global_status.font_id[screen];
vp->line_height = font_get(vp->font)->height; vp->line_height = 0; /* calculate from font height */
vp->drawmode = DRMODE_SOLID; vp->drawmode = DRMODE_SOLID;
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD

View file

@ -269,7 +269,7 @@ int time_screen(void* ignored)
/* force time to be drawn centered */ /* force time to be drawn centered */
clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER; clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER;
font_h = clock_vps[i].line_height; font_h = clock_vps[i].line_height ?: (int)font_get(clock_vps[i].font)->height;
nb_lines -= 2; /* at least 2 lines for menu */ nb_lines -= 2; /* at least 2 lines for menu */
if (nb_lines > 4) if (nb_lines > 4)
nb_lines = 4; nb_lines = 4;

View file

@ -453,7 +453,7 @@ void LCDFN(scroll_fn)(void)
continue; continue;
LCDFN(set_viewport)(s->vp); LCDFN(set_viewport)(s->vp);
height = s->vp->line_height; height = s->vp->line_height ?: (int)font_get(s->vp->font)->height;
if (s->backward) if (s->backward)
s->offset -= LCDFN(scroll_info).step; s->offset -= LCDFN(scroll_info).step;

View file

@ -43,7 +43,7 @@ struct viewport {
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
int flags; int flags;
int font; int font;
int line_height; int line_height; /* 0 for using font height */
int drawmode; int drawmode;
#endif #endif
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1