X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fscree-cairo.c;h=d203b62eff4d983c2f5f5ceada6052d53f3c1331;hb=e91782a2d25dec932c93b7a57bd03d836614ba43;hp=d48a3642a805c3190feffad8fbcaf84c8c31b71c;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp diff --git a/src/output/charts/scree-cairo.c b/src/output/charts/scree-cairo.c index d48a3642a8..d203b62eff 100644 --- a/src/output/charts/scree-cairo.c +++ b/src/output/charts/scree-cairo.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,11 +16,11 @@ #include -#include +#include "output/charts/scree.h" #include -#include +#include "output/cairo-chart.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -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, max); - xrchart_write_xscale (cr, geom, 0, rc->eval->size + 1, 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)