diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-11-25 18:13:14 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-11-25 18:13:14 -0500 |
commit | e67e39554616b359b938e4b9f7178c616cba4f7f (patch) | |
tree | c0839598fc94188410a431c50d9f2fdc5d642c07 | |
parent | 2a498a47fc8836eb2baae3a4fb9e7e0316402fa6 (diff) |
fix simple text rendering
-rw-r--r-- | base.h | 2 | ||||
-rw-r--r-- | text.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -14,6 +14,8 @@ #include <stdio.h> #include <stddef.h> #include <stdarg.h> +#include <float.h> +#include <limits.h> #include <assert.h> typedef uint8_t u8; @@ -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); |