diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-06-22 12:39:34 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-06-29 13:38:22 +0000 |
| commit | 424d0450840bc3db018457787fcdf93db101b265 (patch) | |
| tree | d37cc0a3fa44ed4fec524876508e6c16867d189b | |
| parent | render: xcursor_update(): convert local ‘scale’ variable to float (diff) | |
term: reload_fonts(): ‘scale’ is not a float
| -rw-r--r-- | terminal.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 = { |
