From 1ea10b83bcfb79119f0d321c3331a0dcf0ec0de9 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 1 May 2007 20:40:15 +0000 Subject: [PATCH] if the graph goes 'down' minval must be hanged instead git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1041 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index e16e5d84..7e607bba 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -497,7 +497,10 @@ apply_gridfit(image_desc_t *im) double new_range = factor * (im->maxval - im->minval); double gridstep = im->ygrid_scale.gridstep; double minor_y, minor_y_px, minor_y_px_frac; - im->maxval = im->minval + new_range; + if (im->maxval > 0.0) + im->maxval = im->minval + new_range; + else + im->minval = im->maxval - new_range; ytr(im,DNAN); /* reset precalc */ /* make sure first minor gridline is on integer pixel y coord */ minor_y = gridstep * floor(im->minval / gridstep); -- 2.30.2