From 424d0450840bc3db018457787fcdf93db101b265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 22 Jun 2023 14:39:34 +0200 Subject: [PATCH] =?UTF-8?q?term:=20reload=5Ffonts():=20=E2=80=98scale?= =?UTF-8?q?=E2=80=99=20is=20not=20a=20float?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- terminal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminal.c b/terminal.c index 815dc2d4..43ba157b 100644 --- a/terminal.c +++ b/terminal.c @@ -1000,14 +1000,14 @@ reload_fonts(struct terminal *term) bool use_px_size = term->font_sizes[i][j].px_size > 0; char size[64]; - const int scale = term->font_is_sized_by_dpi ? 1 : term->scale; + const float scale = term->font_is_sized_by_dpi ? 1. : term->scale; if (use_px_size) snprintf(size, sizeof(size), ":pixelsize=%d", - term->font_sizes[i][j].px_size * scale); + (int)round(term->font_sizes[i][j].px_size * scale)); else snprintf(size, sizeof(size), ":size=%.2f", - term->font_sizes[i][j].pt_size * (double)scale); + term->font_sizes[i][j].pt_size * scale); size_t len = strlen(font->pattern) + strlen(size) + 1; names[i][j] = xmalloc(len); @@ -1232,7 +1232,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .reverse_wrap = true, .auto_margin = true, .window_title_stack = tll_init(), - .scale = 1, + .scale = 1., .flash = {.fd = flash_fd}, .blink = {.fd = -1}, .vt = {