]> git.cworth.org Git - acre/blobdiff - acre.c
Fix rounding when deciding between major and minor tick
[acre] / 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;