Fix `ren_font_group_get_tab_size` returning unexpected values

We were casting the `xadvance` to an int, so in some cases the resulting 
tab size was wrong.
This commit is contained in:
Guldoman 2022-04-26 04:33:46 +02:00
parent f42dbb0060
commit 7dd83bb737
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ void ren_font_group_set_tab_size(RenFont **fonts, int n) {
} }
int ren_font_group_get_tab_size(RenFont **fonts) { int ren_font_group_get_tab_size(RenFont **fonts) {
int advance = font_get_glyphset(fonts[0], '\t', 0)->metrics['\t'].xadvance; float advance = font_get_glyphset(fonts[0], '\t', 0)->metrics['\t'].xadvance;
if (fonts[0]->space_advance) { if (fonts[0]->space_advance) {
advance /= fonts[0]->space_advance; advance /= fonts[0]->space_advance;
} }