when moving the data pointers we should take into account how fahr off they
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 7 Aug 2004 23:46:35 +0000 (23:46 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 7 Aug 2004 23:46:35 +0000 (23:46 +0000)
are. Found by David M. Grimes <dgrimes@navisite.com>

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@287 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c

index 9597daf..6d91954 100644 (file)
@@ -913,7 +913,8 @@ data_calc( image_desc_t *im){
                   im->gdes[gdi].rpnp[rpi].op == OP_PREV_OTHER){
                         long ptr = im->gdes[gdi].rpnp[rpi].ptr;
                         if(im->gdes[gdi].start > im->gdes[ptr].start) {
-                            im->gdes[gdi].rpnp[rpi].data += im->gdes[gdi].rpnp[rpi].ds_cnt;
+                            im->gdes[gdi].rpnp[rpi].data += im->gdes[gdi].rpnp[rpi].ds_cnt
+                               * ((im->gdes[gdi].start - im->gdes[ptr].start) / im->gdes[ptr].step);
                         }
                      }
                 }