From 25f0c213ed8d9d0912c0de8c2506d0820939aafd Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sun, 19 Oct 2025 17:02:36 -0400 Subject: scrolling --- font.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'font.c') diff --git a/font.c b/font.c index aff5a30..c67e427 100644 --- a/font.c +++ b/font.c @@ -66,6 +66,8 @@ bool freetype_init(client_state* state, const char* file) { } state->load_flags = FT_LOAD_RENDER; state->line_height = state->ft_face->size->metrics.height >> 6; + state->horizontal_spacing = state->line_height / 2.0f; + return true; } @@ -154,7 +156,7 @@ void atlas_calc_item_widths(client_state* state) { 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); + state->required_width = MAX(state->required_width, item->pixel_len + state->horizontal_spacing); } } } -- cgit v1.2.3