diff options
author | San Jacobs | 2023-10-13 18:29:41 +0200 |
---|---|---|
committer | San Jacobs | 2023-10-13 18:29:41 +0200 |
commit | 0256cea0b389506bc97d1c026d566706e1cc8e76 (patch) | |
tree | 14790dd5c7ec81c50a0ffd2226d8c93332e814ac | |
parent | da32e6dfa55f6550185e8a9b5e7c7f51f41abac7 (diff) | |
download | satscalc-0256cea0b389506bc97d1c026d566706e1cc8e76.tar.gz satscalc-0256cea0b389506bc97d1c026d566706e1cc8e76.tar.bz2 satscalc-0256cea0b389506bc97d1c026d566706e1cc8e76.zip |
Fixed font loading in labels
-rw-r--r-- | src/ui_implementation.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui_implementation.odin b/src/ui_implementation.odin index 7c5f9e3..594e5a1 100644 --- a/src/ui_implementation.odin +++ b/src/ui_implementation.odin @@ -88,7 +88,7 @@ button :: proc(text: string, width: int, selected := false) -> Item { Text_Alignment :: enum int { Left, Right, - Center + Center, } label :: proc(text: string, font: rl.Font, alignment: Text_Alignment = .Left) -> Item { item := oui.item_make() @@ -97,6 +97,7 @@ label :: proc(text: string, font: rl.Font, alignment: Text_Alignment = .Left) -> data.subtype = .Label data.text = text data.font_size = font.baseSize // This should not be necesssary + data.font = font data.alignment = alignment return item @@ -135,7 +136,7 @@ ui_draw :: proc(item: oui.Item) { // For some reason, data.font.baseSize == 0 here. It doesn't outside of this function. Dunno why. font_height := f32(data.font_size) - + rl.DrawTextEx(data.font, strings.unsafe_string_to_cstring(data.text), { 0, 0 }, font_height, 0.0, rl.RAYWHITE); //rl.DrawTextEx(rl.GetFontDefault(), strings.unsafe_string_to_cstring(data.text), { 0, 0 }, 40, 0, rl.WHITE); //rl.DrawFPS(0, 0) |