aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-04 17:41:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-08 17:05:20 +0000
commit8b260568fbf9d1e420b7bdacd971ba0f82a96fd4 (patch)
tree049efc7a93b9c6d0c0fc77fed306e6feaaeabd39 /terminal.c
parentchangelog: move entry to ‘unreleased’ (diff)
term: ensure cell dimensions are non-zero
Closes #830
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 25310d36..ac887412 100644
--- a/terminal.c
+++ b/terminal.c
@@ -688,6 +688,11 @@ term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4])
: max(term->fonts[0]->height,
term->fonts[0]->ascent + term->fonts[0]->descent);
+ if (term->cell_width <= 0)
+ term->cell_width = 1;
+ if (term->cell_height <= 0)
+ term->cell_height = 1;
+
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);