diff options
Diffstat (limited to 'font.c')
| -rw-r--r-- | font.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -151,8 +151,10 @@ int atlas_get_strwidth(client_state* state, const char* str) { } void atlas_calc_item_widths(client_state* state) { - array_for_all(item_t, item, state->items) { - item->pixel_len = atlas_get_strwidth(state, item->text); - state->required_width = MAX(state->required_width, item->pixel_len + state->line_height / 2.0f); + if (state->items) { + array_for_all(item_t, item, state->items) { + item->pixel_len = atlas_get_strwidth(state, item->text); + state->required_width = MAX(state->required_width, item->pixel_len + state->line_height / 2.0f); + } } } |
