add get_serial_cache_font_width to calc the whole line ser_cache width

This commit is contained in:
cuu
2022-03-08 00:55:03 -06:00
parent 8eff139781
commit 3237703ec3
3 changed files with 28 additions and 3 deletions

View File

@@ -711,7 +711,15 @@ void parse_serial_stream(CONFIG*cfg,uint8_t input_ch){
}
//read utf8 codename
//
a = (ser_cache.idx+1)*current_font.width+(ser_cache.idx)*0+ g_config.margin.width;
if(cfg->font->mode == FONT_MODE_1) {
a = get_serial_cache_font_width(&g_config);
a+= (ser_cache.idx)*0+ g_config.margin.width;
}else {
a = (ser_cache.idx+1)*current_font.width+(ser_cache.idx)*0+ g_config.margin.width;
}
if( a >= MAX_DOTS)//got enough points to print
{
if(cfg->font->mode == FONT_MODE_1){