summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-23 00:18:07 -0500
committerpommicket <pommicket@gmail.com>2022-12-23 00:18:07 -0500
commit7f98e047cb791b84cc955f534a7e94395fed1ae0 (patch)
treeb295b9bdbd8ad4bcd88e7e73f025109d5b63af93 /text.c
parentdaee4283b56603e172aac547c20c5534e588f60d (diff)
show documentation!
Diffstat (limited to 'text.c')
-rw-r--r--text.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/text.c b/text.c
index 6d40cc5..6df77ff 100644
--- a/text.c
+++ b/text.c
@@ -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));