aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-05 20:14:43 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-05 20:14:43 +0100
commit7498535a49042dc58c6dfc9ef4df6e7e77ab93fa (patch)
treeada48d2e1b939a2ac2c4844ac9d34c0dfdb81c56 /tests
parentddc745dab8b03e25e77e143aafb8e26a7af299d1 (diff)
Fix incorrect height for multiline text in bounds calculationHEADmaster
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/main.c b/tests/main.c
index 3ec5738..09e59ed 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -62,7 +62,15 @@ static void draw(mgl_window *window, void *userdata) {
mgl_text text;
mgl_text_init(&text, u->font, str, strlen(str));
mgl_text_set_max_width(&text, 200.0f);
- mgl_text_set_max_rows(&text, 5);
+ //mgl_text_set_max_rows(&text, 5);
+ {
+ mgl_rectangle text_bg = {
+ .position = text.position,
+ .size = mgl_text_get_bounds(&text),
+ .color = { 255, 0, 0, 255 },
+ };
+ mgl_rectangle_draw(context, &text_bg);
+ }
mgl_text_draw(context, &text);
mgl_text_deinit(&text);