diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Arc.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/generic/Arc.c b/generic/Arc.c index b6b0252..9d86514 100644 --- a/generic/Arc.c +++ b/generic/Arc.c @@ -642,7 +642,7 @@ Draw(ZnItem item) ZnWInfo *wi = item->wi; ArcItem arc = (ArcItem) item; XGCValues values; - unsigned int width=0, height=0; + int x=0, y=0, width=0, height=0; ZnPoint *p=NULL; XPoint *xp=NULL; unsigned int num_points=0, i; @@ -662,8 +662,22 @@ Draw(ZnItem item) p = ZnListArray(arc->render_shape); } else { - width = ((int) (arc->corner.x - arc->orig.x)); - height = ((int) (arc->corner.y - arc->orig.y)); + if (arc->corner.x > arc->orig.x) { + x = ((int) arc->orig.x); + width = ((int) (arc->corner.x - arc->orig.x)); + } + else { + x = ((int) arc->corner.x); + width = ((int) (arc->orig.x - arc->corner.x)); + } + if (arc->corner.y > arc->orig.y) { + y = ((int) arc->orig.y); + height = ((int) (arc->corner.y - arc->orig.y)); + } + else { + y = ((int) arc->corner.y); + height = ((int) (arc->orig.y - arc->corner.y)); + } } /* Fill if requested */ @@ -701,10 +715,7 @@ Draw(ZnItem item) } else { XFillArc(wi->dpy, wi->draw_buffer, wi->gc, - (int) arc->orig.x, - (int) arc->orig.y, - (unsigned int) width, - (unsigned int) height, + x, y, (unsigned int) width, (unsigned int) height, -arc->start_angle*64, -arc->angle_extent*64); } } @@ -768,10 +779,7 @@ Draw(ZnItem item) } else { XDrawArc(wi->dpy, wi->draw_buffer, wi->gc, - (int) arc->orig.x, - (int) arc->orig.y, - (unsigned int) width, - (unsigned int) height, + x, y, (unsigned int) width, (unsigned int) height, -arc->start_angle*64, -arc->angle_extent*64); } } |