From c4f7117a983147777138266b669b9d72dfe20fb6 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 3 May 2007 12:43:15 +0000 Subject: [PATCH] Testing an double and an integer for equality is bound to produce odd results on times. Don't do it! -- rrdtool@oldach.net git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1052 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 69d6871..aae1317 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1673,8 +1673,8 @@ int draw_horizontal_grid(image_desc_t *im) for (i = sgrid; i <= egrid; i++){ double Y0=ytr(im,im->ygrid_scale.gridstep*i); double YN=ytr(im,im->ygrid_scale.gridstep*(i+1)); - if ( Y0 >= im->yorigin-im->ysize - && Y0 <= im->yorigin){ + if ( round(Y0) >= im->yorigin-im->ysize + && round(Y0) <= im->yorigin){ /* Make sure at least 2 grid labels are shown, even if it doesn't agree with the chosen settings. Add a label if required by settings, or if there is only one label so far and the next grid line is out of bounds. */ -- 2.11.0