diff --git a/src/actions.c b/src/actions.c index 1a03c18e..79d85cf4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1810,7 +1810,7 @@ void new_arc(int what, double sweep) if(sweep_angle==360.) b=360.; if(r>0.) { push_undo(); - drawarc(rectcolor, NOW, x, y, r, a, b, 0); + drawarc(rectcolor, NOW, x, y, r, a, b, 0, 0); store_arc(-1, x, y, r, a, b, rectcolor, 0, NULL); } ui_state &= ~STARTARC; diff --git a/src/draw.c b/src/draw.c index 9b0ebe68..63b51625 100644 --- a/src/draw.c +++ b/src/draw.c @@ -535,7 +535,7 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot, angle = fmod(angle, 360.); if(angle<0.) angle+=360.; ROTATION(0.0,0.0,arc.x,arc.y,x1,y1); - drawarc(c,what, x0+x1, y0+y1, arc.r, angle, arc.b, arc.fill); + drawarc(c,what, x0+x1, y0+y1, arc.r, angle, arc.b, arc.fill, arc.dash); } if( (layer != PINLAYER || enable_layer[layer]) ) for(j=0;j< symptr->rects[layer];j++) @@ -1100,15 +1100,14 @@ void filledarc(int c, int what, double x, double y, double r, double a, double b } -void drawarc(int c, int what, double x, double y, double r, double a, double b, int arc_fill) +void drawarc(int c, int what, double x, double y, double r, double a, double b, int arc_fill, int dash) { static int i=0; static XArc arc[CADDRAWBUFFERSIZE]; double x1, y1, x2, y2; /* arc bbox */ double xx1, yy1, xx2, yy2; /* complete circle bbox in screen coords */ - - if(arc_fill) what = NOW; + if(arc_fill || dash) what = NOW; if(!has_x) return; if(what & ADD) @@ -1155,6 +1154,13 @@ void drawarc(int c, int what, double x, double y, double r, double a, double b, y2=Y_TO_SCREEN(y2); if( rectclip(areax1,areay1,areax2,areay2,&x1,&y1,&x2,&y2) ) { + if(dash) { + char dash_arr[2]; + dash_arr[0] = dash_arr[1] = dash; + XSetDashes(display, gc[c], 0, dash_arr, 2); + XSetLineAttributes (display, gc[c], lw ,LineDoubleDash, CapButt , JoinBevel); + } + if(draw_window) { XDrawArc(display, window, gc[c], xx1, yy1, xx2-xx1, yy2-yy1, a*64, b*64); } @@ -1170,9 +1176,9 @@ void drawarc(int c, int what, double x, double y, double r, double a, double b, XFillArc(display, save_pixmap, gcstipple[c], xx1, yy1, xx2-xx1, yy2-yy1, a*64, b*64); } } - - - + if(dash) { + XSetLineAttributes (display, gc[c], lw ,LineSolid, CapRound , JoinRound); + } } } else if(what & BEGIN) i=0; @@ -1550,7 +1556,7 @@ void draw(void) } for(i=0;i