aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graphics/text.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/graphics/text.c b/src/graphics/text.c
index e84e4b1..e872360 100644
--- a/src/graphics/text.c
+++ b/src/graphics/text.c
@@ -67,8 +67,7 @@ static void mgl_text_for_each_codepoint(const mgl_text *self, codepoint_loop_cal
if(((glyph_offset.x + kerning + glyph_width > self->max_width) && self->max_width > 0.001f) || codepoint == '\n') {
glyph_offset.x = 0.0f;
- if(codepoint != '\n')
- glyph_offset.y += self->font->character_size;
+ glyph_offset.y += self->font->character_size;
prev_codepoint = 0;
if(rows == self->max_rows)
@@ -82,8 +81,8 @@ static void mgl_text_for_each_codepoint(const mgl_text *self, codepoint_loop_cal
return;
glyph_offset.x += glyph_width;
- if(codepoint == '\n')
- glyph_offset.y += self->font->character_size;
+ //if(codepoint == '\n')
+ // glyph_offset.y += self->font->character_size;
prev_codepoint = codepoint;
@@ -100,7 +99,7 @@ typedef struct {
static bool calculate_bounds_callback(codepoint_loop_callback_data callback_data, void *userdata) {
CalculateBoundsUserdata *calculate_bounds_userdata = userdata;
calculate_bounds_userdata->bounds.x = max_float(calculate_bounds_userdata->bounds.x, callback_data.glyph_offset.x + callback_data.glyph_width);
- calculate_bounds_userdata->bounds.y = max_float(calculate_bounds_userdata->bounds.y, callback_data.glyph_offset.y);
+ calculate_bounds_userdata->bounds.y = max_float(calculate_bounds_userdata->bounds.y, callback_data.glyph_offset.y + callback_data.glyph->size.y);
return true;
}