summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvPoly.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-07-04 00:40:10 (GMT)
committerhobbs <hobbs>2001-07-04 00:40:10 (GMT)
commit373b5564f0c6b27cf7fe31039de7dbfd2f2b7c59 (patch)
treeb6f5250e87ea8190f5721122d191ae6adb11f980 /generic/tkCanvPoly.c
parent0bced951cdfa31c4f20538788063f8836d3b6d68 (diff)
downloadtk-373b5564f0c6b27cf7fe31039de7dbfd2f2b7c59.zip
tk-373b5564f0c6b27cf7fe31039de7dbfd2f2b7c59.tar.gz
tk-373b5564f0c6b27cf7fe31039de7dbfd2f2b7c59.tar.bz2
* tests/canvas.test:
* generic/tkCanvPoly.c (PolygonToArea): Added patch that respects the polygon difference of including points in the polygon even when fill is empty. [Bug #226357]
Diffstat (limited to 'generic/tkCanvPoly.c')
-rw-r--r--generic/tkCanvPoly.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 8e21d4f..c4adf3c 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvPoly.c,v 1.7 2001/07/03 06:03:44 hobbs Exp $
+ * RCS: @(#) $Id: tkCanvPoly.c,v 1.8 2001/07/04 00:40:11 hobbs Exp $
*/
#include <stdio.h>
@@ -1484,21 +1484,16 @@ PolygonToArea(canvas, itemPtr, rectPtr)
polyPoints = polyPtr->coordPtr;
}
- if (polyPtr->fillGC != None) {
- inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
- if (inside==0) goto donearea;
- } else {
- if ((polyPoints[0] >= rectPtr[0])
- && (polyPoints[0] <= rectPtr[2])
- && (polyPoints[1] >= rectPtr[1])
- && (polyPoints[1] <= rectPtr[3])) {
- inside = 1;
- }
- }
+ /*
+ * Simple test to see if we are in the polygon. Polygons are
+ * different from othe canvas items in that they register points
+ * being inside even if it isn't filled.
+ */
+ inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
+ if (inside==0) goto donearea;
if (polyPtr->outline.gc == None) goto donearea ;
-
/*
* Iterate through all of the edges of the line, computing a polygon
* for each edge and testing the area against that polygon. In