diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 23:50:21 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-17 23:50:21 +0100 |
commit | b79a28355ded0118f6e53f745684d67c8201bf30 (patch) | |
tree | e6ca1b72bb13af10fac441b1103401bb40cd6d5c /overlay | |
parent | f185f46114620ff8938abc965f89ecb4d295b4f4 (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/chart.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |