From: John Darrington Date: Fri, 28 May 2010 11:49:43 +0000 (+0200) Subject: Fix inconsistent label positions on piecharts. X-Git-Tag: v0.7.6~388 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=571a1c6fa3b068837f98dcf3ad98d69753fd7634;p=pspp-builds.git Fix inconsistent label positions on piecharts. The labels of piechart slices did not match the positions of the slices (possibly due to libplot legacy). This change fixes this problem. --- diff --git a/src/output/charts/piechart-cairo.c b/src/output/charts/piechart-cairo.c index 501c0bd4..3917e4e1 100644 --- a/src/output/charts/piechart-cairo.c +++ b/src/output/charts/piechart-cairo.c @@ -81,11 +81,11 @@ xrchart_draw_piechart (const struct chart_item *chart_item, cairo_t *cr, const double segment_angle = pie->slices[i].magnitude / total_magnitude * 2 * M_PI ; - const double label_x = centre_x - - radius * sin(angle + segment_angle/2.0); + const double label_x = centre_x + + radius * cos (angle + segment_angle/2.0); const double label_y = centre_y + - radius * cos(angle + segment_angle/2.0); + radius * sin (angle + segment_angle/2.0); /* Fill the segment */ draw_segment (cr,