From e67e39554616b359b938e4b9f7178c616cba4f7f Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 25 Nov 2020 18:13:14 -0500 Subject: fix simple text rendering --- base.h | 2 ++ text.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base.h b/base.h index 3a8b4a9..114563f 100644 --- a/base.h +++ b/base.h @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include typedef uint8_t u8; diff --git a/text.c b/text.c index 762bfd9..5906e5c 100644 --- a/text.c +++ b/text.c @@ -217,7 +217,7 @@ void text_render_char(Font *font, char32_t c, TextRenderState *state) { static void text_render_internal(Font *font, char const *text, float *x, float *y) { mbstate_t mbstate = {0}; - TextRenderState render_state = {*x, *y}; + TextRenderState render_state = {.x = *x, .y = *y, .min_x = -FLT_MAX, .max_x = FLT_MAX, .min_y = -FLT_MAX, .max_y = FLT_MAX}; text_chars_begin(font); char32_t c = 0; char const *end = text + strlen(text); -- cgit v1.2.3