From 56c5a1da4de4a7511882b2a9d4bae608aca1e61b Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Sun, 19 Oct 2025 00:26:59 -0400 Subject: change allow-free-result to exact-match --- font.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'font.c') diff --git a/font.c b/font.c index a1e29be..3903698 100644 --- a/font.c +++ b/font.c @@ -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); + } } } -- cgit v1.2.3