aboutsummaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/draw.c b/draw.c
index b0c32ba..aed4da0 100644
--- a/draw.c
+++ b/draw.c
@@ -11,7 +11,7 @@
// (this will also work for animations in the future)
// or use some flags to trigger drawing
-Drawable *draw_create(Window *win, const char *font, int height, int left_pad, int right_pad, int top_pad, double alpha)
+Drawable *draw_create(const char *font, int height, int left_pad, int right_pad, int top_pad, double alpha)
{
Drawable *draw = g_malloc(sizeof(Drawable));
g_assert_nonnull(draw);
@@ -20,19 +20,20 @@ Drawable *draw_create(Window *win, const char *font, int height, int left_pad, i
draw->desc = pango_font_description_from_string(font);
log_debug("Pango found matching font '%s'", pango_font_description_get_family(draw->desc));
- draw->win = win;
draw->height = height;
draw->left_pad = left_pad;
draw->right_pad = right_pad;
draw->top_pad = top_pad;
draw->alpha = alpha;
+ g_assert(alpha >= 0 && alpha <= 1);
+
+ log_debug("Draw context created [height=%d, left_pad=%d, right_pad=%d, top_pad=%d, alpha=%.2lf]", height, left_pad, right_pad, top_pad, alpha);
return draw;
}
-void draw_paint(Drawable *draw)
+void draw_paint(Drawable *draw, Window *win)
{
- Window *win = draw->win;
// FIXME: Does not work for scale != 1
//double scale = window_get_scale(win);
double scale = 1;