aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet2005-05-25 08:22:14 +0000
committerlecoanet2005-05-25 08:22:14 +0000
commit31fd725293702db26ebbe5461ad31a352c4eb11a (patch)
tree0b65430e7f25d725e8fa21d5721d3f184f53c4ef
parent3f823b2fb0a17832ade53e017ca7743a4fd85ee2 (diff)
downloadtkzinc-31fd725293702db26ebbe5461ad31a352c4eb11a.zip
tkzinc-31fd725293702db26ebbe5461ad31a352c4eb11a.tar.gz
tkzinc-31fd725293702db26ebbe5461ad31a352c4eb11a.tar.bz2
tkzinc-31fd725293702db26ebbe5461ad31a352c4eb11a.tar.xz
Fixed a drawing bug under X occuring on full extent arcs when either
X or Y scale is reverted.
-rw-r--r--generic/Arc.c30
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);
}
}