font: preserve font cursor

main
Dominik Madarász 2024-02-10 21:55:16 +01:00
parent 0ae82acfea
commit 737e4ce33f
3 changed files with 6 additions and 6 deletions

View File

@ -363805,7 +363805,7 @@ vec2 font_clip(const char *text, vec4 rect) {
}
vec2 dims = font_draw_ex(text, gotoxy, rect, NULL, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? rect.x : gotoxy.x + dims.x;
gotoxy.x = strchr(text, '\n') ? gotoxy.x + rect.x : gotoxy.x + dims.x;
return dims;
}
}
@ -363889,7 +363889,7 @@ vec2 font_highlight(const char *text, const void *colors) {
vec4 screen_dim = {0, 0, window_width(), window_height()};
vec2 dims = font_draw_ex(text, gotoxy, screen_dim, (const char *)colors, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? 0 : gotoxy.x + dims.x;
gotoxy.x += !strchr(text, '\n') ? gotoxy.x + dims.x : 0;
return dims;
}

View File

@ -2248,7 +2248,7 @@ vec2 font_clip(const char *text, vec4 rect) {
}
vec2 dims = font_draw_ex(text, gotoxy, rect, NULL, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? rect.x : gotoxy.x + dims.x;
gotoxy.x = strchr(text, '\n') ? gotoxy.x + rect.x : gotoxy.x + dims.x;
return dims;
}
}
@ -2332,7 +2332,7 @@ vec2 font_highlight(const char *text, const void *colors) {
vec4 screen_dim = {0, 0, window_width(), window_height()};
vec2 dims = font_draw_ex(text, gotoxy, screen_dim, (const char *)colors, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? 0 : gotoxy.x + dims.x;
gotoxy.x += !strchr(text, '\n') ? gotoxy.x + dims.x : 0;
return dims;
}

View File

@ -10946,7 +10946,7 @@ vec2 font_clip(const char *text, vec4 rect) {
}
vec2 dims = font_draw_ex(text, gotoxy, rect, NULL, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? rect.x : gotoxy.x + dims.x;
gotoxy.x = strchr(text, '\n') ? gotoxy.x + rect.x : gotoxy.x + dims.x;
return dims;
}
}
@ -11030,7 +11030,7 @@ vec2 font_highlight(const char *text, const void *colors) {
vec4 screen_dim = {0, 0, window_width(), window_height()};
vec2 dims = font_draw_ex(text, gotoxy, screen_dim, (const char *)colors, font_draw_cmd);
gotoxy.y += strchr(text, '\n') ? dims.y : 0;
gotoxy.x = strchr(text, '\n') ? 0 : gotoxy.x + dims.x;
gotoxy.x += !strchr(text, '\n') ? gotoxy.x + dims.x : 0;
return dims;
}