X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcartesian.c;h=9dceb304ebb75c33477d5989b9bac0b512ba5baf;hb=5ff91bd55867848d448c2f09bc7057cc1fb77b18;hp=e4a5fe1352f3323b8bc8035dfab69e2c33f7ca01;hpb=4fdeb2145d081ff1b84e3f6c99f9d1c048c0d64a;p=pspp diff --git a/src/cartesian.c b/src/cartesian.c index e4a5fe1352..9dceb304eb 100644 --- a/src/cartesian.c +++ b/src/cartesian.c @@ -133,24 +133,22 @@ write_legend(struct chart *chart, const char *heading, void chart_datum(struct chart *ch, int dataset UNUSED, double x, double y) { - if ( ! ch ) return ; + { + const double x_pos = + (x - ch->x_min) * ch->abscissa_scale + ch->data_left ; + const double y_pos = + (y - ch->y_min) * ch->ordinate_scale + ch->data_bottom ; - const double x_pos = - (x - ch->x_min) * ch->abscissa_scale + ch->data_left ; - - const double y_pos = - (y - ch->y_min) * ch->ordinate_scale + ch->data_bottom ; - - pl_savestate_r(ch->lp); + pl_savestate_r(ch->lp); - pl_fmarker_r(ch->lp, x_pos, y_pos, 6, 15); - - pl_restorestate_r(ch->lp); + pl_fmarker_r(ch->lp, x_pos, y_pos, 6, 15); + pl_restorestate_r(ch->lp); + } } /* Draw a line with slope SLOPE and intercept INTERCEPT.