summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-23 14:48:35 +0100
committerPhil Jones <philj56@gmail.com>2022-06-23 14:48:35 +0100
commit128fa39bb62d1a1c627812f15030bf3ffb82100d (patch)
treee16020dd31faf4a2033ac45a3038981b8c54276c /src/main.c
parentc57d9a2a65725dce8632bea6e539517f6b5e8f7d (diff)
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.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 7 insertions, 5 deletions
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");