summaryrefslogtreecommitdiffstats
path: root/apps/gui/viewport.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r--apps/gui/viewport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index c5e44270d4..33ffed79f3 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -223,6 +223,8 @@ static bool is_theme_enabled(enum screen_type screen)
int viewport_get_nb_lines(const struct viewport *vp)
{
#ifdef HAVE_LCD_BITMAP
+ if (!vp->line_height)
+ return vp->height/font_get(vp->font)->height;
return vp->height/vp->line_height;
#else
(void)vp;
@@ -318,7 +320,7 @@ void viewport_set_fullscreen(struct viewport *vp,
set_default_align_flags(vp);
#endif
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;
#if LCD_DEPTH > 1
#ifdef HAVE_REMOTE_LCD