From b79a28355ded0118f6e53f745684d67c8201bf30 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 17 Aug 2013 23:50:21 +0100 Subject: overlay: Improve the horizontal fit of the charts Notably fix the fill boundary to not extend past the right hand side of the chart. Signed-off-by: Chris Wilson --- overlay/chart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'overlay/chart.c') diff --git a/overlay/chart.c b/overlay/chart.c index 46adbac2..8b46cadb 100644 --- a/overlay/chart.c +++ b/overlay/chart.c @@ -138,7 +138,7 @@ void chart_draw(struct chart *chart, cairo_t *cr) cairo_translate(cr, chart->x, chart->y + chart->h); cairo_scale(cr, - chart->w / (double)chart->num_samples, + chart->w / (double)(chart->num_samples-1), -chart->h / (chart->range[1] - chart->range[0])); x = 0; @@ -162,7 +162,7 @@ void chart_draw(struct chart *chart, cairo_t *cr) n, value_at(chart, i + n)); } if (chart->mode != CHART_STROKE) - cairo_line_to(cr, max, 0); + cairo_line_to(cr, n-1, 0); cairo_identity_matrix(cr); cairo_set_line_width(cr, chart->stroke_width); -- cgit v1.2.3