diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2017-07-26 16:15:59 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-26 16:15:59 -0300 |
commit | 821d50f0b49237052c988f4170737ebce17f33d6 (patch) | |
tree | 24862245d03ad151cb730d7edbe886752763dfde /Meter.c | |
parent | ef7817c17a35dd5f8d9eb9ee65539e52d2fdb410 (diff) | |
parent | 143a7de6b222652455fbe7956414afcda151d634 (diff) |
Merge pull request #651 from Explorer09/graph-mode-draw
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++) { |