aboutsummaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorRiley Beckett <rbeckettvt@gmail.com>2025-10-19 00:26:59 -0400
committerRiley Beckett <rbeckettvt@gmail.com>2025-10-19 00:26:59 -0400
commit56c5a1da4de4a7511882b2a9d4bae608aca1e61b (patch)
treee041ad1554d1f3c66f06e199ee9a93ff74d91f86 /font.c
parentbe014d7b8df14596530ef8f9e7d7a8afae281c5c (diff)
change allow-free-result to exact-match
Diffstat (limited to 'font.c')
-rw-r--r--font.c8
1 files changed, 5 insertions, 3 deletions
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);
+ }
}
}