X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fcartesian.c;h=74840c30c5254e949d610a839d54047a0b46a093;hb=77dc491d3b0c1429801ec839e7afab0fbef6a7fc;hp=ffa6e3c5323c5002d90b7c6868e67a88ef94c936;hpb=e0c37920bb2cc46ee559e3992470572d4b4d27e6;p=pspp-builds.git diff --git a/src/output/charts/cartesian.c b/src/output/charts/cartesian.c index ffa6e3c5..74840c30 100644 --- a/src/output/charts/cartesian.c +++ b/src/output/charts/cartesian.c @@ -19,6 +19,7 @@ #include +#include #include #include @@ -45,15 +46,13 @@ static const struct dataset dataset[DATASETS] = /* Plot a data point */ void -chart_datum (plPlotter *lp, const struct chart_geometry *geom, +chart_datum (cairo_t *cr, const struct chart_geometry *geom, int dataset UNUSED, double x, double y) { double x_pos = (x - geom->x_min) * geom->abscissa_scale + geom->data_left; double y_pos = (y - geom->y_min) * geom->ordinate_scale + geom->data_bottom; - pl_savestate_r (lp); - pl_fmarker_r (lp, x_pos, y_pos, 6, 15); - pl_restorestate_r (lp); + chart_draw_marker (cr, x_pos, y_pos, MARKER_SQUARE, 15); } /* Draw a line with slope SLOPE and intercept INTERCEPT. @@ -62,7 +61,7 @@ chart_datum (plPlotter *lp, const struct chart_geometry *geom, y axis otherwise the x axis */ void -chart_line(plPlotter *lp, const struct chart_geometry *geom, +chart_line(cairo_t *cr, const struct chart_geometry *geom, double slope, double intercept, double limit1, double limit2, enum CHART_DIM lim_dim) { @@ -89,7 +88,7 @@ chart_line(plPlotter *lp, const struct chart_geometry *geom, x1 = (x1 - geom->x_min) * geom->abscissa_scale + geom->data_left; x2 = (x2 - geom->x_min) * geom->abscissa_scale + geom->data_left; - pl_savestate_r (lp); - pl_fline_r (lp, x1, y1, x2, y2); - pl_restorestate_r (lp); + cairo_move_to (cr, x1, y1); + cairo_line_to (cr, x2, y2); + cairo_stroke (cr); }