From 6512f8c73cab49615959179bd76a4664df58ef5c Mon Sep 17 00:00:00 2001 From: FelixKratz Date: Tue, 14 Sep 2021 00:10:38 +0200 Subject: [PATCH] always draw graphs inside border --- src/bar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bar.c b/src/bar.c index 9592b4d..1c1b058 100644 --- a/src/bar.c +++ b/src/bar.c @@ -111,12 +111,12 @@ void bar_draw_graph_line(struct bar *bar, struct graph_data* graph_data, uint32_ CGContextStrokePath(bar->context); if (fill) { if (right_to_left) { - CGPathAddLineToPoint(p, NULL, x + sample_width, 0); - CGPathAddLineToPoint(p, NULL, start_x, 0); + CGPathAddLineToPoint(p, NULL, x + sample_width, y); + CGPathAddLineToPoint(p, NULL, start_x, y); } else { - CGPathAddLineToPoint(p, NULL, x - sample_width, 0); - CGPathAddLineToPoint(p, NULL, start_x, 0); + CGPathAddLineToPoint(p, NULL, x - sample_width, y); + CGPathAddLineToPoint(p, NULL, start_x, y); } CGPathCloseSubpath(p); CGContextAddPath(bar->context, p); @@ -142,7 +142,7 @@ static int bar_get_center_length(struct bar_manager* bar_manager) { void bar_draw_graph(struct bar* bar, struct bar_item* bar_item, uint32_t x, bool right_to_left) { if (!bar_item->has_graph) return; - bar_draw_graph_line(bar, &bar_item->graph_data, x, 0, right_to_left); + bar_draw_graph_line(bar, &bar_item->graph_data, x, g_bar_manager.border_width + 1, right_to_left); } void bar_draw_item_background(struct bar* bar, struct bar_item* bar_item, uint32_t sid) {