aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-12 22:15:00 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-17 15:55:39 +0000
commit09354286955a6a7eb05e0e336ce7fc9cc43cb5f3 (patch)
tree4375bba04f2e5f275d1047f46dd27bf1f74d809d /terminal.h
parentMerge branch 'reflow-performance' (diff)
term: remove get_font_scale()
get_font_scale() was used to get the new scaling factor when loading fonts. This was then compared to the last seen font scaling factor. If there was no difference, the fonts were not reloaded. The problem was, the initial term->scale was set differently. This sometimes led to term->scale=2, while get_font_scale() return 1. That meant, fonts were initially scaled by 2 (when dpi-aware=no). Later, when mapped on an output (and thus term->scale being set to 1), the fonts weren’t reloaded with the correct scaling factor since the cached term->font_scale value was already 1. Since term->scale always reflects the *new* scaling factor when term_font_dpi_changed() is called, use that directly, and remove get_font_scale(). Also rename the following functions: * font_should_size_by_dpi() -> font_size_by_dpi_for_scale() * font_size_by_dpi() -> font_sized_by_dpi() * font_size_by_scale() -> font_sized_by_scale()
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/terminal.h b/terminal.h
index 85ba90eb..42e2fd2a 100644
--- a/terminal.h
+++ b/terminal.h
@@ -320,7 +320,7 @@ struct terminal {
struct config_font *font_sizes[4];
struct pt_or_px font_line_height;
float font_dpi;
- int font_scale;
+ int font_scale; /* scaling factor last time we loaded fonts */
int16_t font_x_ofs;
int16_t font_y_ofs;
enum fcft_subpixel font_subpixel;