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:
parent
8345a04d04
commit
8156836126
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue