diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2025-10-19 17:02:36 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2025-10-19 17:02:36 -0400 |
| commit | 25f0c213ed8d9d0912c0de8c2506d0820939aafd (patch) | |
| tree | 6741b925a37426a930ca589f708a76fb71d143bb /font.c | |
| parent | cd9cc6e14bb26cb3754fbe0db21dbb39d442d962 (diff) | |
scrolling
Diffstat (limited to 'font.c')
| -rw-r--r-- | font.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } } } |
