(MaterialUI) prevent crashes when font driver is NULL
This commit is contained in:
parent
4dfda8743c
commit
43a6213b68
|
@ -667,6 +667,9 @@ static void mui_compute_entries_box(mui_handle_t* mui, int width)
|
|||
float scale_factor = menu_display_get_dpi();
|
||||
uintptr_t texture_switch2 = 0;
|
||||
|
||||
if (!mui->font)
|
||||
return;
|
||||
|
||||
for (i = 0; i < entries_end; i++)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
|
@ -930,6 +933,7 @@ static void mui_render_label_value(mui_handle_t *mui, mui_node_t *node,
|
|||
|
||||
word_wrap(sublabel_str, sublabel_str, (int)((usable_width - icon_margin) / mui->glyph_width2), false);
|
||||
|
||||
if (mui->font)
|
||||
menu_display_draw_text(mui->font2, sublabel_str,
|
||||
mui->margin + (texture_switch2 ? mui->icon_size : 0),
|
||||
y + (scale_factor / 4) + mui->font->size,
|
||||
|
@ -1597,6 +1601,7 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
|||
strlcpy(title_buf, title_buf_msg_tmp, sizeof(title_buf));
|
||||
}
|
||||
|
||||
if (mui->font)
|
||||
menu_display_draw_text(mui->font, title_buf,
|
||||
title_margin,
|
||||
header_height / 2 + mui->font->size / 3,
|
||||
|
|
Loading…
Reference in New Issue