mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-23 20:03:10 +00:00
always draw graphs inside border
This commit is contained in:
parent
09dfee4dd7
commit
6512f8c73c
1 changed files with 5 additions and 5 deletions
10
src/bar.c
10
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) {
|
||||
|
|
Loading…
Reference in a new issue