From 31fd725293702db26ebbe5461ad31a352c4eb11a Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 25 May 2005 08:22:14 +0000 Subject: Fixed a drawing bug under X occuring on full extent arcs when either X or Y scale is reverted. --- generic/Arc.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'generic') 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); } } -- cgit v1.1