aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-10-10 12:23:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-10-10 12:23:33 +0000
commit4449177517c2d96857483acbc8afd7438fcdfadd (patch)
tree16ca700c8bb42ab78f141467c811fdf24107e0b5 /terminal.c
parentterm_font_baseline(): only center glyph when a custom line-height is being used (diff)
term: cache font baseline
No need to redo the calculation for every single cell we render, every frame...
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index e517253b..efbbded1 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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);