diff options
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 1 | ||||
-rw-r--r-- | apps/gui/viewport.c | 4 | ||||
-rw-r--r-- | apps/menus/time_menu.c | 2 | ||||
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 2 | ||||
-rw-r--r-- | firmware/export/lcd.h | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index a9689a8e00..1557783a7c 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1694,7 +1694,6 @@ static bool skin_load_fonts(struct wps_data *data) | |||
1694 | 1694 | ||
1695 | /* finally, assign the font_id to the viewport */ | 1695 | /* finally, assign the font_id to the viewport */ |
1696 | vp->font = font->id; | 1696 | vp->font = font->id; |
1697 | vp->line_height = font_get(vp->font)->height; | ||
1698 | } | 1697 | } |
1699 | data->font_ids = skin_buffer_alloc(font_count * sizeof(int)); | 1698 | data->font_ids = skin_buffer_alloc(font_count * sizeof(int)); |
1700 | if (!success || data->font_ids == NULL) | 1699 | if (!success || data->font_ids == NULL) |
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) | |||
223 | int viewport_get_nb_lines(const struct viewport *vp) | 223 | int viewport_get_nb_lines(const struct viewport *vp) |
224 | { | 224 | { |
225 | #ifdef HAVE_LCD_BITMAP | 225 | #ifdef HAVE_LCD_BITMAP |
226 | if (!vp->line_height) | ||
227 | return vp->height/font_get(vp->font)->height; | ||
226 | return vp->height/vp->line_height; | 228 | return vp->height/vp->line_height; |
227 | #else | 229 | #else |
228 | (void)vp; | 230 | (void)vp; |
@@ -318,7 +320,7 @@ void viewport_set_fullscreen(struct viewport *vp, | |||
318 | set_default_align_flags(vp); | 320 | set_default_align_flags(vp); |
319 | #endif | 321 | #endif |
320 | vp->font = global_status.font_id[screen]; | 322 | vp->font = global_status.font_id[screen]; |
321 | vp->line_height = font_get(vp->font)->height; | 323 | vp->line_height = 0; /* calculate from font height */ |
322 | vp->drawmode = DRMODE_SOLID; | 324 | vp->drawmode = DRMODE_SOLID; |
323 | #if LCD_DEPTH > 1 | 325 | #if LCD_DEPTH > 1 |
324 | #ifdef HAVE_REMOTE_LCD | 326 | #ifdef HAVE_REMOTE_LCD |
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index c4fe49aa49..9be335c8ee 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -269,7 +269,7 @@ int time_screen(void* ignored) | |||
269 | /* force time to be drawn centered */ | 269 | /* force time to be drawn centered */ |
270 | clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER; | 270 | clock_vps[i].flags |= VP_FLAG_ALIGN_CENTER; |
271 | 271 | ||
272 | font_h = clock_vps[i].line_height; | 272 | font_h = clock_vps[i].line_height ?: (int)font_get(clock_vps[i].font)->height; |
273 | nb_lines -= 2; /* at least 2 lines for menu */ | 273 | nb_lines -= 2; /* at least 2 lines for menu */ |
274 | if (nb_lines > 4) | 274 | if (nb_lines > 4) |
275 | nb_lines = 4; | 275 | nb_lines = 4; |
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index fb49deb76b..878c08863b 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -453,7 +453,7 @@ void LCDFN(scroll_fn)(void) | |||
453 | continue; | 453 | continue; |
454 | 454 | ||
455 | LCDFN(set_viewport)(s->vp); | 455 | LCDFN(set_viewport)(s->vp); |
456 | height = s->vp->line_height; | 456 | height = s->vp->line_height ?: (int)font_get(s->vp->font)->height; |
457 | 457 | ||
458 | if (s->backward) | 458 | if (s->backward) |
459 | s->offset -= LCDFN(scroll_info).step; | 459 | s->offset -= LCDFN(scroll_info).step; |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index e68795391f..f4336233ab 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -43,7 +43,7 @@ struct viewport { | |||
43 | #ifdef HAVE_LCD_BITMAP | 43 | #ifdef HAVE_LCD_BITMAP |
44 | int flags; | 44 | int flags; |
45 | int font; | 45 | int font; |
46 | int line_height; | 46 | int line_height; /* 0 for using font height */ |
47 | int drawmode; | 47 | int drawmode; |
48 | #endif | 48 | #endif |
49 | #if LCD_DEPTH > 1 | 49 | #if LCD_DEPTH > 1 |