term: cache font baseline

No need to redo the calculation for every single cell we render,
every frame...
This commit is contained in:
Daniel Eklöf 2023-10-10 14:23:33 +02:00
parent 34aa979f46
commit 4449177517
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 12 additions and 9 deletions

View file

@ -774,6 +774,8 @@ term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4],
term->font_x_ofs = term_pt_or_px_as_pixels(term, &conf->horizontal_letter_offset);
term->font_y_ofs = term_pt_or_px_as_pixels(term, &conf->vertical_letter_offset);
term->font_baseline = term_font_baseline(term);
LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height);
sixel_cell_size_changed(term);