mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-10 19:08:39 +00:00
minor fixes
This commit is contained in:
parent
fe054ebb13
commit
d5e8a0c936
|
|
@ -237,7 +237,7 @@ int32 font_to_data(
|
|||
memcpy(pos, font->glyphs, font->glyph_count * sizeof(Glyph));
|
||||
pos += font->glyph_count * sizeof(Glyph);
|
||||
|
||||
int32 size = (int32) (pos - data);
|
||||
int32 size = font_data_size(font);
|
||||
|
||||
SWAP_ENDIAN_LITTLE_SIMD(
|
||||
(int32 *) file.content,
|
||||
|
|
@ -246,7 +246,12 @@ int32 font_to_data(
|
|||
steps
|
||||
);
|
||||
|
||||
return font_data_size(font);
|
||||
return size;
|
||||
}
|
||||
|
||||
f32 font_line_height(Font* font, f32 size)
|
||||
{
|
||||
return font->line_height * size / font->size;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -510,7 +510,7 @@ f32 vertex_text_create(
|
|||
f32 offset_x = x;
|
||||
for (int32 i = 0; i < length; ++i) {
|
||||
int32 character = is_ascii ? text[i] : utf8_get_char_at(text, i);
|
||||
if (character == '\n') {
|
||||
if (character == '\n' && i != 0) {
|
||||
y -= font->line_height * scale;
|
||||
offset_x = x;
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ f32 ui_text_create(
|
|||
for (int32 i = 0; i < length; ++i) {
|
||||
int32 character = is_ascii ? text->value_str[i] : utf8_get_char_at(text->value_str, i);
|
||||
|
||||
if (character == '\n') {
|
||||
if (character == '\n' && i != 0) {
|
||||
offset_y += theme->font.line_height * scale;
|
||||
offset_x = (f32) x->value_int;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user