X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fscree-cairo.c;h=726e250856e219ebd56d50f9d4083ceaa6ed8be6;hb=refs%2Fheads%2Fmatrix2;hp=db0ce1370fccb36ede5b65c04931d2267bcc2ffa;hpb=aad0ae4913ecd01ccc954f8828623ad5da35cd1b;p=pspp diff --git a/src/output/charts/scree-cairo.c b/src/output/charts/scree-cairo.c index db0ce1370f..726e250856 100644 --- a/src/output/charts/scree-cairo.c +++ b/src/output/charts/scree-cairo.c @@ -26,10 +26,10 @@ #define _(msgid) gettext (msgid) void -xrchart_draw_scree (const struct chart_item *chart_item, cairo_t *cr, +xrchart_draw_scree (const struct chart *chart, cairo_t *cr, struct xrchart_geometry *geom) { - const struct scree *rc = to_scree (chart_item); + const struct scree *rc = to_scree (chart); size_t i; double min, max; @@ -39,13 +39,15 @@ xrchart_draw_scree (const struct chart_item *chart_item, cairo_t *cr, gsl_vector_minmax (rc->eval, &min, &max); - if ( fabs (max) > fabs (min)) + if (fabs (max) > fabs (min)) max = fabs (max); else max = fabs (min); - xrchart_write_yscale (cr, geom, 0, max); - xrchart_write_xscale (cr, geom, 0, rc->eval->size + 1); + if (! xrchart_write_yscale (cr, geom, 0, max)) + return; + if (! xrchart_write_xscale (cr, geom, 0, rc->eval->size + 1)) + return; xrchart_vector_start (cr, geom, ""); for (i = 0 ; i < rc->eval->size; ++i)