Text rendering is now around parity (if not better) than what was done before with raylib

Performance still sucks since the rendering implementation is subpar
This commit is contained in:
2024-06-24 23:19:08 -04:00
parent 321bbfd772
commit 6f722026ce
9 changed files with 217 additions and 161 deletions

View File

@ -71,11 +71,14 @@ ui_box_compute_layout :: proc( box : ^UI_Box,
adjusted_size.y = max( adjusted_max_size_y, layout.size.min.y)
text_size : Vec2
if layout.font_size == computed.text_size.y {
text_size = computed.text_size
}
else {
text_size = cast(Vec2) measure_text_size( box.text.str, style.font, layout.font_size, 0 )
if len(box.text.str) > 0
{
if layout.font_size == computed.text_size.y {
text_size = computed.text_size
}
else {
text_size = cast(Vec2) measure_text_size( box.text.str, style.font, layout.font_size, 0 )
}
}
if size_to_text {