diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/graphics/text.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/graphics/text.c b/src/graphics/text.c index 92c578c..0942b62 100644 --- a/src/graphics/text.c +++ b/src/graphics/text.c @@ -155,6 +155,8 @@ static bool find_character_pos_callback(size_t codepoint_index, uint32_t codepoi } else { find_character_pos_userdata->position.x += glyph->advance + mgl_font_get_kerning(find_character_pos_userdata->text->font, find_character_pos_userdata->prev_codepoint, codepoint); } + + find_character_pos_userdata->prev_codepoint = codepoint; return true; } @@ -203,6 +205,7 @@ static bool text_draw_callback(size_t codepoint_index, uint32_t codepoint, const mgl_text_draw_glyph(text_draw_userdata->context, glyph, (mgl_vec2i){ text_draw_userdata->position.x, text_draw_userdata->position.y }); text_draw_userdata->position.x += glyph->advance; } + text_draw_userdata->prev_codepoint = codepoint; return true; } |