diff options
| author | Federico Angelilli <code@fedang.net> | 2024-04-14 00:29:28 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-04-14 00:29:28 +0200 |
| commit | 3768820fb27ff394114a17f6612417bcc78689a0 (patch) | |
| tree | 9f954b70fcb3855f0d3c3e955a5ad3b233287401 /src/draw.c | |
| parent | cccfc17f790e84a9e574af97726cc5ef63a22447 (diff) | |
Fix size scaling and use scale only every 25%
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -188,7 +188,7 @@ static void compute_width(Drawer *draw, Window *win) { int screen_width = win->con->screen_size->width; double scale = window_get_scale(win); - draw->width = screen_width / scale - draw->right_pad - draw->left_pad; + draw->width = (screen_width - draw->right_pad - draw->left_pad) / scale; log_debug("Draw context width calculated [scale=%lf, width=%d]", scale, draw->width); } @@ -368,20 +368,17 @@ void draw_set_context(Drawer *draw, PangoContext *context) log_debug("Pango context updated [context=%p]", context); } -void draw_set_size(Drawer *draw, int height, int left_pad, int right_pad, int top_pad, double scale) +void draw_set_size(Drawer *draw, int height, int left_pad, int right_pad, int top_pad) { g_assert(height > 0); - draw->height = height / scale; - draw->left_pad = left_pad / scale; - draw->right_pad = right_pad / scale; - draw->top_pad = top_pad / scale; + draw->height = height; + draw->left_pad = left_pad; + draw->right_pad = right_pad; + draw->top_pad = top_pad; log_debug("Draw context size updated [height=%d, left_pad=%d, right_pad=%d, top_pad=%d]", height, left_pad, right_pad, top_pad); - - log_debug("Draw context size scaled [scale=%lf, height=%d, left_pad=%d, right_pad=%d, top_pad=%d]", - scale, draw->height, draw->left_pad, draw->right_pad, draw->top_pad); } void draw_destroy(Drawer *draw) |
