diff options
author | ericm <ericm> | 2000-04-19 22:20:44 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-04-19 22:20:44 (GMT) |
commit | 981af3eaf3d7d2aac6fc833575521e05a925811c (patch) | |
tree | f3c02e2e6954c9f9322d606d17f4e7e26a4b1f5a /generic/tkRectOval.c | |
parent | 65fb9b709cd298c9528eadbb2f5e7969a9b897c0 (diff) | |
download | tk-981af3eaf3d7d2aac6fc833575521e05a925811c.zip tk-981af3eaf3d7d2aac6fc833575521e05a925811c.tar.gz tk-981af3eaf3d7d2aac6fc833575521e05a925811c.tar.bz2 |
* generic/tkRectOval.c (ConfigureRectOval): Added checks for valid
outline settings before creating of outline GC; this means that it
is really possible now to have an oval or rectangle with no
outline. [Bug: 5029].
Diffstat (limited to 'generic/tkRectOval.c')
-rw-r--r-- | generic/tkRectOval.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index b5c78e2..95634c5 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.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: tkRectOval.c,v 1.6 2000/02/01 11:41:10 hobbs Exp $ + * RCS: @(#) $Id: tkRectOval.c,v 1.7 2000/04/19 22:20:45 ericm Exp $ */ #include <stdio.h> @@ -430,7 +430,6 @@ ConfigureRectOval(interp, canvas, itemPtr, argc, argv, flags) (char *) rectOvalPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } - state = itemPtr->state; /* @@ -466,9 +465,18 @@ ConfigureRectOval(interp, canvas, itemPtr, argc, argv, flags) tsoffset->yoffset = (int) (rectOvalPtr->bbox[2] + 0.5); } + /* + * Configure the outline graphics context. If mask is non-zero, + * the gc has changed and must be reallocated, provided that the + * new settings specify a valid outline (non-zero width and non-NULL + * color) + */ + mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr, &(rectOvalPtr->outline)); - if (mask) { + if (mask && \ + rectOvalPtr->outline.width != 0 && \ + rectOvalPtr->outline.color != NULL) { gcValues.cap_style = CapProjecting; mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); |