aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-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;