diff options
author | marosg <[email protected]> | 2017-09-25 20:10:38 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-09-27 07:03:49 +0200 |
commit | b74e6421f0814e53d52c9634516810d126bfd8be (patch) | |
tree | 1496953cd78457c0d38f3cf285e0386988907fc2 /multiload/load-graph.c | |
parent | eb1bf01e73c42faf720a723c7270ee0c1233ab81 (diff) | |
download | mate-applets-b74e6421f0814e53d52c9634516810d126bfd8be.tar.bz2 mate-applets-b74e6421f0814e53d52c9634516810d126bfd8be.tar.xz |
Rounding error in draw corrected.
Diffstat (limited to 'multiload/load-graph.c')
-rw-r--r-- | multiload/load-graph.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/multiload/load-graph.c b/multiload/load-graph.c index 5eefd36c..5e0c16f8 100644 --- a/multiload/load-graph.c +++ b/multiload/load-graph.c @@ -125,11 +125,15 @@ load_graph_draw (LoadGraph *g) /* draw grid lines in Load graph if needed */ gdk_cairo_set_source_rgba (cr, &(g->colors [2])); + + double spacing = 0; for (k = 0; k < load - 1; k++) { - cairo_move_to (cr, 0.5, (g->draw_height/load)*(k+1)); - cairo_line_to (cr, g->draw_width-0.5, (g->draw_height/load)*(k+1)); - } + spacing = ((double) g->draw_height/load) * (k+1); + cairo_move_to (cr, 0.5, spacing); + cairo_line_to (cr, g->draw_width-0.5, spacing); + } + cairo_stroke (cr); } gtk_widget_queue_draw (g->disp); |