diff options
author | lecoanet | 2004-03-04 08:54:55 +0000 |
---|---|---|
committer | lecoanet | 2004-03-04 08:54:55 +0000 |
commit | c924463312c85c71902addaa39a874214d7e6f77 (patch) | |
tree | bc62eab7541e63b2316a23350b6317d62e166cf5 | |
parent | 653a94a4a40c2f1c01bdda9345c999f91c310b27 (diff) | |
download | tkzinc-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.
-rw-r--r-- | generic/Rectangle.c | 20 |
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; |