aboutsummaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/draw.c b/src/draw.c
index c47aa00..44baba6 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -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)