Fixed ui rendering issue with getting vertical metrics unscaled.

This commit is contained in:
2025-01-04 10:13:30 -05:00
parent cb6053395c
commit d6e232b3f7
4 changed files with 15 additions and 14 deletions

View File

@ -191,14 +191,14 @@ ui_box_compute_layout :: proc( box : ^UI_Box,
{
ascent, descent, line_gap := get_font_vertical_metrics(style.font, layout.font_size)
offset := text_size
offset += { 0, -descent }
// offset := text_size
// offset += { 0, -descent }
content_size := content_bounds.max - content_bounds.min
text_pos : Vec2
text_pos = content_bounds.min
text_pos += { 0, -descent }
text_pos = content_bounds.min
text_pos += (content_size - text_size) * layout.text_alignment
text_pos += { 0, -descent }
computed.text_size = text_size
computed.text_pos = text_pos