From 65cf862db1ef94180cd6773b43d4dbad8623ee4a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 10 Sep 2024 22:23:50 +0200 Subject: Rows count from 1 --- src/graphics/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics/text.c') diff --git a/src/graphics/text.c b/src/graphics/text.c index 89994c5..f635bf6 100644 --- a/src/graphics/text.c +++ b/src/graphics/text.c @@ -35,7 +35,7 @@ static void mgl_text_for_each_codepoint(const mgl_text *self, codepoint_loop_cal float glyph_width = 0.0f; uint32_t prev_codepoint = 0; mgl_vec2f glyph_offset = {0, 0}; - unsigned int rows = 0; + unsigned int rows = 1; for(size_t i = 0; i < self->text_size;) { unsigned char *cp = (unsigned char*)&self->text[i]; @@ -71,9 +71,9 @@ static void mgl_text_for_each_codepoint(const mgl_text *self, codepoint_loop_cal glyph_offset.y += self->font->character_size; prev_codepoint = 0; - ++rows; if(rows == self->max_rows) return; + ++rows; } else { glyph_offset.x += kerning; } -- cgit v1.2.3