From ae80cde66c8f8f5d45716048615a3c604739abad Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 16 Aug 2016 02:31:27 -0300 Subject: [PATCH] eeshow/lib-render.c (draw_arc): support filling --- eeshow/lib-render.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/eeshow/lib-render.c b/eeshow/lib-render.c index 366ee43..1bbb807 100644 --- a/eeshow/lib-render.c +++ b/eeshow/lib-render.c @@ -131,10 +131,28 @@ static void draw_arc(const struct lib_arc *arc, const int m[6]) } } + /* + * cr_arc (and maybe others) close the arc if filling, so we supply a + * foreground color as well. Other objects are closed and don't need + * need a foreground color when filling. + */ + switch (arc->fill) { + case 'N': + break; + case 'F': + gfx_arc(x, y, arc->r, sa, ea, + COLOR_COMP_DWG, COLOR_COMP_DWG, LAYER_COMP_DWG_BG); + break; + case 'f': + gfx_arc(x, y, arc->r, sa, ea, + COLOR_COMP_DWG_BG, COLOR_COMP_DWG_BG, LAYER_COMP_DWG_BG); + break; + default: + assert(0); + } + gfx_arc(x, y, arc->r, sa, ea, COLOR_COMP_DWG, COLOR_NONE, LAYER_COMP_DWG); - - assert(arc->fill == 'N'); }