diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-10 22:23:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-10 22:23:50 +0200 |
commit | 65cf862db1ef94180cd6773b43d4dbad8623ee4a (patch) | |
tree | 6ba521090743ba8f5dc34894a9d69f1d1ba5dd57 /src/graphics | |
parent | 2a91f0dca320f6be061224cb42ceb31c32a51b6c (diff) |
Rows count from 1
Diffstat (limited to 'src/graphics')
-rw-r--r-- | src/graphics/text.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |