aboutsummaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-10-19 17:02:36 -0400
committerJack Jamison <jackqjamison@gmail.com>2025-10-19 17:02:36 -0400
commit25f0c213ed8d9d0912c0de8c2506d0820939aafd (patch)
tree6741b925a37426a930ca589f708a76fb71d143bb /font.c
parentcd9cc6e14bb26cb3754fbe0db21dbb39d442d962 (diff)
scrolling
Diffstat (limited to 'font.c')
-rw-r--r--font.c4
1 files changed, 3 insertions, 1 deletions
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);
}
}
}