diff options
| author | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-19 00:26:59 -0400 |
|---|---|---|
| committer | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-19 00:26:59 -0400 |
| commit | 56c5a1da4de4a7511882b2a9d4bae608aca1e61b (patch) | |
| tree | e041ad1554d1f3c66f06e199ee9a93ff74d91f86 /font.c | |
| parent | be014d7b8df14596530ef8f9e7d7a8afae281c5c (diff) | |
change allow-free-result to exact-match
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); + } } } |
