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 committed by Adam Harrison
parent 8345a04d04
commit 8156836126
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 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) {
advance /= fonts[0]->space_advance;
}