From: Alex van den Bogaerdt Date: Thu, 21 Mar 2002 12:00:51 +0000 (+0000) Subject: Pie charts didn't have anti-aliasing; building them clockwise X-Git-Tag: 1.2rc1~236 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1cf6c927200b0be68305e627be83286161c75ad8;p=thirdparty%2Frrdtool-1.x.git Pie charts didn't have anti-aliasing; building them clockwise seems to solve this problem. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@98 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index ea7ed0d2..111aaa67 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1844,6 +1844,51 @@ int lazy_check(image_desc_t *im){ return size; } +void +pie_part(gfx_canvas_t *canvas, gfx_color_t color, + double PieCenterX, double PieCenterY, double Radius, + double startangle, double endangle) +{ + gfx_node_t *node; + double angle; + double step=M_PI/50; /* Number of iterations for the circle; + ** 10 is definitely too low, more than + ** 50 seems to be overkill + */ + + /* Strange but true: we have to work clockwise or else + ** anti aliasing nor transparency don't work. + ** + ** This test is here to make sure we do it right, also + ** this makes the for...next loop more easy to implement. + ** The return will occur if the user enters a negative number + ** (which shouldn't be done according to the specs) or if the + ** programmers do something wrong (which, as we all know, never + ** happens anyway :) + */ + if (endangle