diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-27 19:42:03 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-27 22:42:33 +0100 |
commit | 08fe64b91e7e43db54628f922f07864a8d8e5402 (patch) | |
tree | d2599eefb3a9bfbcce927bd4898e04eb0193ba73 /src/graphics/text.c | |
parent | 0e3128798912a46705323d5c6546c2bdf2ade678 (diff) |
Use correct offset y for font position (ascent)
Diffstat (limited to 'src/graphics/text.c')
-rw-r--r-- | src/graphics/text.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/graphics/text.c b/src/graphics/text.c index 66ef7e3..92c578c 100644 --- a/src/graphics/text.c +++ b/src/graphics/text.c @@ -213,10 +213,11 @@ void mgl_text_draw(mgl_context *context, mgl_text *text) { return; /* Calculate bounds beforehand if needed, which also generates glyphs because opengl outputs an error if that is done inside glBegin/glEnd */ + /* TODO: Only run this on the new glyphs */ mgl_text_get_bounds(text); TextDrawUserdata text_draw_userdata; - text_draw_userdata.position = (mgl_vec2f){ text->position.x, text->position.y + text->font->character_size }; + text_draw_userdata.position = (mgl_vec2f){ text->position.x, text->position.y }; text_draw_userdata.text = text; text_draw_userdata.context = context; text_draw_userdata.prev_codepoint = 0; |