diff options
| author | Federico Angelilli <code@fedang.net> | 2023-12-11 17:22:25 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-12-11 17:22:25 +0100 |
| commit | c13a74d93c62e8e867afcbed487bcbc7955b29e7 (patch) | |
| tree | 9e18aa3f7d397612f1a7dbd4efcc0d2c9bda5086 /src/draw.c | |
| parent | ffdfcf5d8ad1265e6beeea5780bda895221cd506 (diff) | |
Fix drawing
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -66,19 +66,8 @@ void draw_paint(Drawable *draw, Window *win) double degree = M_PI / 180.0; + // Fill the background cairo_set_source_rgba(cr, draw->background.r, draw->background.g, draw->background.b, draw->background.a); - - // TODO: Here we should paint the shape of the bar, however there is a problem with the surface - // painted in the pixmap to mask the window shape in window_paint_corners. - // - // This is caused by some difference between the two shapes (that should technically be the same) - // which causes a mismatch between the two layers and leaves some black pixels visible - - //int radius = height / 2; - //cairo_arc(cr, radius, radius, radius, 90.0 * degree, 270 * degree); - //cairo_arc(cr, width - radius, radius, radius, 270 * degree, 450 * degree); - //cairo_fill(cr); - cairo_paint(cr); int line_w = draw->line_w * scale; @@ -276,7 +265,7 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns) }; if (layout_end[PANGO_ALIGN_RIGHT] > width) { - log_error("LENGHT %d on %d", layout_end[PANGO_ALIGN_RIGHT], width); + log_error("Layout is bigger than the window (%d vs %d)", layout_end[PANGO_ALIGN_RIGHT], width); } int center = round(width / 2); @@ -288,7 +277,7 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns) layout->x += center_off; } - int right = width - layout_width[PANGO_ALIGN_LEFT]; + int right = width - layout_width[PANGO_ALIGN_RIGHT]; // The width is off by 2 line width int right_off = right - MAX(layout_end[PANGO_ALIGN_LEFT], layout_end[PANGO_ALIGN_CENTER]) + 2 * line_w; log_debug("Aligning right layout [x=%d, off=%d]", right, right_off); |
