From d61bd8f1610016ad178894d007e1cdf6b73b8781 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 30 Dec 2024 19:55:16 -0500 Subject: [PATCH] more misc changes It seems applying ceil to cache_glyph_to_atlas.dst_glyph_size does generally improve text clarity... --- code/font/vefontcache/draw.odin | 2 +- code/sectr/app/settings_menu.odin | 6 ++++-- code/sectr/engine/client_api.odin | 4 ++-- code/sectr/ui/tests.odin | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/font/vefontcache/draw.odin b/code/font/vefontcache/draw.odin index 0a75744..4db32fc 100644 --- a/code/font/vefontcache/draw.odin +++ b/code/font/vefontcache/draw.odin @@ -402,7 +402,7 @@ cache_glyph_to_atlas :: proc( ctx : ^Context, slot_position, slot_size := atlas_bbox( atlas, region_kind, atlas_index ) dst_glyph_position := slot_position - dst_glyph_size := (bounds_size * entry.size_scale + glyph_padding) + dst_glyph_size := ceil(bounds_size * entry.size_scale + glyph_padding) dst_size := (slot_size) screenspace_x_form( & dst_glyph_position, & dst_glyph_size, atlas_size ) screenspace_x_form( & slot_position, & dst_size, atlas_size ) diff --git a/code/sectr/app/settings_menu.odin b/code/sectr/app/settings_menu.odin index 83790c4..c6161f1 100644 --- a/code/sectr/app/settings_menu.odin +++ b/code/sectr/app/settings_menu.odin @@ -70,7 +70,9 @@ ui_settings_menu_builder :: proc( captures : rawptr = nil ) -> ( should_raise : joined_size := size_range2( vbox_children_bounds ) if ! dragged { - min_size.y = joined_size.y + // TODO(Ed): Figure out what this value is + extra_padding :: 3 + min_size.y = joined_size.y + layout.border_width + extra_padding if min_size.y > size.y { pos.y += (layout.size.min.y - min_size.y) * 0.5 layout.pos = pos @@ -87,7 +89,7 @@ ui_settings_menu_builder :: proc( captures : rawptr = nil ) -> ( should_raise : ui_parent(vbox) Frame_Bar: - { + { scope(theme_window_bar) frame_bar := ui_hbox(.Left_To_Right, "Settings Menu: Frame Bar", { .Mouse_Clickable }) { diff --git a/code/sectr/engine/client_api.odin b/code/sectr/engine/client_api.odin index 24f489e..6a8561b 100644 --- a/code/sectr/engine/client_api.odin +++ b/code/sectr/engine/client_api.odin @@ -522,9 +522,9 @@ tick_work_frame :: #force_inline proc( host_delta_time_ms : f64 ) -> b32 config := & get_state().config debug := & get_state().debug - debug.draw_ui_box_bounds_points = true + debug.draw_ui_box_bounds_points = false debug.draw_ui_padding_bounds = false - debug.draw_ui_content_bounds = true + debug.draw_ui_content_bounds = false // config.engine_refresh_hz = 165 diff --git a/code/sectr/ui/tests.odin b/code/sectr/ui/tests.odin index dd6cc6b..a273148 100644 --- a/code/sectr/ui/tests.odin +++ b/code/sectr/ui/tests.odin @@ -170,6 +170,7 @@ test_whitespace_ast :: proc( default_layout : ^UI_Layout, frame_style_default : text_layout.alignment = { 0.0, 1.0 } text_layout.size.min = { 1600, 14 } text_style := frame_style_default ^ + // text_style.text_color = Color_Black text_style_combo := to_ui_style_combo(text_style) text_style_combo.default.bg_color = Color_Transparent text_style_combo.disabled.bg_color = Color_Transparent