summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7acc9e7)
raw | patch | inline | side by side (parent: 7acc9e7)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 9 Nov 2010 16:15:06 +0000 (16:15 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 9 Nov 2010 16:15:06 +0000 (16:15 +0000) |
since some versions of cairo seem to go unstable when this happens. -- Peter Stamfest
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4@2142 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4@2142 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_graph.c | patch | blob | history |
index 5573e1630921f23726fbb80e9c5ce4a5e45182ad..def9c9ccea38089d7d38bf8032bf9686f217d278 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
}
break;
case GF_LINE:
- case GF_AREA:
- /* fix data points at oo and -oo */
+ case GF_AREA: {
+ rrd_value_t diffval = im->maxval - im->minval;
+ rrd_value_t maxlimit = im->maxval + 9 * diffval;
+ rrd_value_t minlimit = im->minval - 9 * diffval;
for (ii = 0; ii < im->xsize; ii++) {
+ /* fix data points at oo and -oo */
if (isinf(im->gdes[i].p_data[ii])) {
if (im->gdes[i].p_data[ii] > 0) {
im->gdes[i].p_data[ii] = im->maxval;
} else {
im->gdes[i].p_data[ii] = im->minval;
}
-
+ }
+ /* some versions of cairo go unstable when trying
+ to draw way out of the canvas ... lets not even try */
+ if (im->gdes[i].p_data[ii] > maxlimit) {
+ im->gdes[i].p_data[ii] = maxlimit;
+ }
+ if (im->gdes[i].p_data[ii] < minlimit) {
+ im->gdes[i].p_data[ii] = minlimit;
}
} /* for */
}
lastgdes = &(im->gdes[i]);
break;
+ } /* GF_AREA, GF_LINE, GF_GRAD */
case GF_STACK:
rrd_set_error
("STACK should already be turned into LINE or AREA here");