aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tafl/tafl.odin11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tafl/tafl.odin b/src/tafl/tafl.odin
index 83fc670..50c68c5 100644
--- a/src/tafl/tafl.odin
+++ b/src/tafl/tafl.odin
@@ -102,6 +102,12 @@ tafl_open :: proc(
parent = &tafl_elements[tafl_stack[tafl_stack_depth-1]]
}
+ if text != "" {
+ measurement := rl.MeasureTextEx(DEFAULT_FONT, strings.clone_to_cstring(text, allocator=context.temp_allocator), f32(FONT_SIZE), 0)
+ width = max(width, int(measurement.x))
+ height = max(height, int(measurement.y))
+ }
+
if width == -1 {
width = parent.inner.width
}
@@ -109,11 +115,6 @@ tafl_open :: proc(
height = parent.inner.height
}
- if text != "" {
- measurement := rl.MeasureTextEx(DEFAULT_FONT, strings.clone_to_cstring(text, allocator=context.temp_allocator), f32(FONT_SIZE), 0)
- width = max(width, int(measurement.x))
- height = max(height, int(measurement.y))
- }
x, y : int
if parent != nil {