diff options
author | hobbs <hobbs> | 2001-07-04 00:40:10 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-07-04 00:40:10 (GMT) |
commit | db633a6d7a0b2cffbb4a3d4c4ac9d420e434ca9e (patch) | |
tree | b6f5250e87ea8190f5721122d191ae6adb11f980 /generic | |
parent | dbc9bdeaec84b5b40eec6b8603998bd5235c9cfc (diff) | |
download | tk-db633a6d7a0b2cffbb4a3d4c4ac9d420e434ca9e.zip tk-db633a6d7a0b2cffbb4a3d4c4ac9d420e434ca9e.tar.gz tk-db633a6d7a0b2cffbb4a3d4c4ac9d420e434ca9e.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')
-rw-r--r-- | generic/tkCanvPoly.c | 21 |
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 |