diff options
author | pommicket <pommicket@gmail.com> | 2022-12-23 00:18:07 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-23 00:18:07 -0500 |
commit | 7f98e047cb791b84cc955f534a7e94395fed1ae0 (patch) | |
tree | b295b9bdbd8ad4bcd88e7e73f025109d5b63af93 /text.c | |
parent | daee4283b56603e172aac547c20c5534e588f60d (diff) |
show documentation!
Diffstat (limited to 'text.c')
-rw-r--r-- | text.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -276,6 +276,8 @@ top: c = UNICODE_BOX_CHARACTER; } if (c >= UNICODE_CODE_POINTS) c = UNICODE_BOX_CHARACTER; // code points this big should never appear in valid Unicode + + uint page = c / CHAR_PAGE_SIZE; uint index = c % CHAR_PAGE_SIZE; if (state->render) { @@ -286,9 +288,16 @@ top: stbtt_bakedchar *char_data = font->char_pages[page]; float const char_height = font->char_height; float const char_width = font->char_width; + if (char_data) { // if page was successfully loaded stbtt_aligned_quad q = {0}; + if (state->wrap && c == '\n') { + state->x = state->min_x; + state->y += char_height; + return; + } + { float x, y; x = (float)(state->x - floor(state->x)); |