Code

Fix error "cairo_restore without matching cairo_save" when zero-time point is out...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 2 Mar 2008 15:38:05 +0000 (15:38 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 2 Mar 2008 15:38:05 +0000 (15:38 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1301 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/src/rrd_graph.c

index 501db48da41e5e3d245a35dc205335a77572b930..56f509a635f817a0bdc1a3ad018efffdf732c99d 100644 (file)
@@ -3346,6 +3346,7 @@ int graph_paint(
         case GF_HRULE:
             if (im->gdes[i].yrule >= im->minval
                 && im->gdes[i].yrule <= im->maxval)
+           {   
                 cairo_save(im->cr);
             if (im->gdes[i].dash) {
                 cairo_set_dash(im->cr, im->gdes[i].p_dashes,
@@ -3358,10 +3359,12 @@ int graph_paint(
                      1.0, im->gdes[i].col);
             cairo_stroke(im->cr);
             cairo_restore(im->cr);
+           }
             break;
         case GF_VRULE:
             if (im->gdes[i].xrule >= im->start
                 && im->gdes[i].xrule <= im->end)
+           {   
                 cairo_save(im->cr);
             if (im->gdes[i].dash) {
                 cairo_set_dash(im->cr, im->gdes[i].p_dashes,
@@ -3373,6 +3376,7 @@ int graph_paint(
                      im->yorigin - im->ysize, 1.0, im->gdes[i].col);
             cairo_stroke(im->cr);
             cairo_restore(im->cr);
+           }
             break;
         default:
             break;