]> git.cworth.org Git - acre/commitdiff
Fix rounding when deciding between major and minor tick
authorCarl Worth <cworth@cworth.org>
Tue, 27 Jan 2009 19:42:44 +0000 (11:42 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 16 Apr 2009 19:05:44 +0000 (12:05 -0700)
We noticed that some charts were missing a major tick, (like
0, 0.5,  ,1.5, 2.0, 2.5). Fix this.

acre.c

diff --git a/acre.c b/acre.c
index 1ca05057544f0bef7ce378f05542beb7b7636163..3ddf14382a880a7db7edebff34512040e34fb1e3 100644 (file)
--- a/acre.c
+++ b/acre.c
@@ -552,7 +552,7 @@ _draw_ticks (acre_t *acre,
         t += sub_step)
     {
        int tick_size;
-       if (fabs((t / step) - (int) (t / step)) < 0.5 * (sub_step / step))
+       if (fabs((t / step) - round (t / step)) < 0.5 * (sub_step / step))
            tick_size = ACRE_TICK_MAJOR_SIZE;
        else
            tick_size = ACRE_TICK_MINOR_SIZE;