X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcairo-chart.c;h=db8eb67ecf45f65625bb2df0229a8b3335d6a17e;hb=dc0e37529d185a9848b0e53d424d40239d195c8c;hp=f3accda3fb504745e4ed083ef8f21a2222b8003a;hpb=e0c5553451a33f2f3bcbd877da0b0e8551d09ff8;p=pspp diff --git a/src/output/cairo-chart.c b/src/output/cairo-chart.c index f3accda3fb..db8eb67ecf 100644 --- a/src/output/cairo-chart.c +++ b/src/output/cairo-chart.c @@ -99,8 +99,8 @@ pango_layout_get_baseline (PangoLayout *layout) } #endif -/* - These colours come from: +/* + These colours come from: http://tango.freedesktop.org/static/cvs/tango-art-tools/palettes/Tango-Palette.gpl */ const struct xrchart_colour data_colour[XRCHART_N_COLOURS] = { @@ -309,7 +309,7 @@ draw_tick_internal (cairo_t *cr, const struct xrchart_geometry *geom, if (orientation == SCALE_ABSCISSA) { - if ( rotated) + if ( rotated) xrchart_label_rotate (cr, 'l', 'c', geom->font_size, s, -G_PI_4); else xrchart_label (cr, 'c', 't', geom->font_size, s); @@ -385,12 +385,13 @@ xrchart_write_scale (cairo_t *cr, struct xrchart_geometry *geom, tick_format_string = chart_get_ticks_format (lower, interval, ticks, &tickscale); upper = lower + interval * (ticks+1); - + geom->axis[orient].max = upper; geom->axis[orient].min = lower; - - geom->axis[orient].scale = (fabs (geom->axis[orient].data_max - geom->axis[orient].data_min) - / fabs (geom->axis[orient].max - geom->axis[orient].min)); + + struct xrchart_axis *axis = &geom->axis[orient]; + geom->axis[orient].scale = (fabs ((double) axis->data_max - axis->data_min) + / fabs (axis->max - axis->min)); if (orient == SCALE_ABSCISSA) { @@ -406,7 +407,7 @@ xrchart_write_scale (cairo_t *cr, struct xrchart_geometry *geom, tickoversize = width > 0.9 * ((double)(geom->axis[SCALE_ABSCISSA].data_max - geom->axis[SCALE_ABSCISSA].data_min))/(ticks+1); } - + double pos = lower; for (s = 0 ; s <= ticks; ++s)