aboutsummaryrefslogtreecommitdiff
path: root/generic/Rectangle.c
diff options
context:
space:
mode:
authorlecoanet2004-03-04 08:54:55 +0000
committerlecoanet2004-03-04 08:54:55 +0000
commitc924463312c85c71902addaa39a874214d7e6f77 (patch)
treebc62eab7541e63b2316a23350b6317d62e166cf5 /generic/Rectangle.c
parent653a94a4a40c2f1c01bdda9345c999f91c310b27 (diff)
downloadtkzinc-c924463312c85c71902addaa39a874214d7e6f77.zip
tkzinc-c924463312c85c71902addaa39a874214d7e6f77.tar.gz
tkzinc-c924463312c85c71902addaa39a874214d7e6f77.tar.bz2
tkzinc-c924463312c85c71902addaa39a874214d7e6f77.tar.xz
Fixed an incorerct behavior in Rectangle ToArea method when
both filled and a line width is specified.
Diffstat (limited to 'generic/Rectangle.c')
-rw-r--r--generic/Rectangle.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/generic/Rectangle.c b/generic/Rectangle.c
index a8cefb4..51fe10d 100644
--- a/generic/Rectangle.c
+++ b/generic/Rectangle.c
@@ -417,15 +417,18 @@ ToArea(ZnItem item,
ZnToArea ta)
{
RectangleItem rect = (RectangleItem) item;
- int result;
+ int result, result2;
ZnBBox *area = ta->area;
result = -1;
if (ISSET(rect->flags, FILLED_BIT)) {
result = ZnPolygonInBBox(rect->dev, 4, area, NULL);
+ if (result == 0) {
+ return 0;
+ }
}
- else if (rect->line_width > 0) {
+ if (rect->line_width > 0) {
int i;
ZnPoint pts[5];
@@ -433,8 +436,17 @@ ToArea(ZnItem item,
pts[i] = rect->dev[i];
}
pts[4] = pts[0];
- result = ZnPolylineInBBox(pts, 5, rect->line_width,
- CapProjecting, JoinMiter, area);
+ result2 = ZnPolylineInBBox(pts, 5, rect->line_width,
+ CapProjecting, JoinMiter, area);
+ if (ISCLEAR(rect->flags, FILLED_BIT)) {
+ if (result2 == 0) {
+ return 0;
+ }
+ result = result2;
+ }
+ else if (result2 != result) {
+ return 0;
+ }
}
return result;