diff options
author | Explorer09 <explorer09@gmail.com> | 2016-07-22 12:44:16 +0800 |
---|---|---|
committer | Explorer09 <explorer09@gmail.com> | 2017-07-15 22:14:44 +0800 |
commit | 143a7de6b222652455fbe7956414afcda151d634 (patch) | |
tree | 903f14caebe9ffc7c0bf04c1a8c7888934c06a9a /Meter.c | |
parent | 71785e2ded88f25370b24b06978a78f4fd2ba524 (diff) |
Round values in graph drawing (instead of implicit truncate)
Diffstat (limited to 'Meter.c')
-rw-r--r-- | Meter.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -406,8 +406,8 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { } for (; i < nValues; i+=2, k++) { int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT; - int v1 = CLAMP(data->values[i] * pix, 1, pix); - int v2 = CLAMP(data->values[i+1] * pix, 1, pix); + int v1 = CLAMP((int) lround(data->values[i] * pix), 1, pix); + int v2 = CLAMP((int) lround(data->values[i+1] * pix), 1, pix); int colorIdx = GRAPH_1; for (int line = 0; line < GRAPH_HEIGHT; line++) { |