From 128fa39bb62d1a1c627812f15030bf3ffb82100d Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Thu, 23 Jun 2022 14:48:35 +0100 Subject: Remove Cairo scale factor. The scale factor is now only used to scale font sizes, not all Cairo drawing operations. This makes pixel-sized options correct. --- src/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2523022..2cc48f6 100644 --- a/src/main.c +++ b/src/main.c @@ -768,6 +768,9 @@ int main(int argc, char *argv[]) */ parse_args(&tofi, argc, argv); + /* Scale fonts to the correct size. */ + tofi.window.entry.font_size *= tofi.window.scale; + /* * If we were invoked as tofi-run, generate the command list. * Otherwise, just read standard input. @@ -834,8 +837,8 @@ int main(int argc, char *argv[]) -1); zwlr_layer_surface_v1_set_size( tofi.window.zwlr_layer_surface, - tofi.window.width, - tofi.window.height); + tofi.window.width / tofi.window.scale, + tofi.window.height / tofi.window.scale); zwlr_layer_surface_v1_set_margin( tofi.window.zwlr_layer_surface, tofi.window.margin_top, @@ -881,9 +884,8 @@ int main(int argc, char *argv[]) entry_init( &tofi.window.entry, tofi.window.surface.shm_pool_data, - tofi.window.surface.width, - tofi.window.surface.height, - tofi.window.scale); + tofi.window.width, + tofi.window.height); entry_update(&tofi.window.entry); log_unindent(); log_debug("Renderer initialised.\n"); -- cgit v1.2.3