summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-07 22:14:59 -0400
committerpommicket <pommicket@gmail.com>2023-09-07 22:50:12 -0400
commit5100257c186d52ffb61fe26e302ec7205f291599 (patch)
tree9baa768319798c30fd7639061bab303def06d413 /ui.c
parentb8be8dd9239f1b08cb578539e634de73751fbad8 (diff)
fix issue where selector detail is cut off
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui.c b/ui.c
index 3dd7875..21ba7ab 100644
--- a/ui.c
+++ b/ui.c
@@ -310,7 +310,6 @@ void selector_render(Ted *ted, Selector *s) {
text_state.max_x = x2;
text_state.min_y = selector_entries_start_y(ted, s);
text_state.max_y = y2;
- text_state.render = true;
// render entries themselves
u32 i_display = 0;
@@ -336,11 +335,12 @@ void selector_render(Ted *ted, Selector *s) {
if (entry->detail) {
// draw detail
- float detail_size = text_get_size_vec2(font, entry->detail).x;
+ const float detail_size = text_get_size_vec2(font, entry->detail).x;
TextRenderState detail_state = text_state;
- detail_state.x = maxd(text_state.x + 2 * padding, x2 - detail_size);
+ detail_state.x = floor(maxd(text_state.x + 2 * padding, detail_state.max_x - detail_size));
settings_color_floats(settings, COLOR_COMMENT, detail_state.color);
+ text_state_break_kerning(&detail_state);
text_utf8_with_state(font, &detail_state, entry->detail);
}
}