summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-04 12:27:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-04 12:27:18 (GMT)
commit271b2253102a315cd4aa422f7ee6bbe53c370b35 (patch)
tree1c5337abc1b86ba6fa88b36952a57b43a65f7a04
parent8a1c217bbd4e954734e4b2bd8f6385bdc40ca6f1 (diff)
downloadtk-271b2253102a315cd4aa422f7ee6bbe53c370b35.zip
tk-271b2253102a315cd4aa422f7ee6bbe53c370b35.tar.gz
tk-271b2253102a315cd4aa422f7ee6bbe53c370b35.tar.bz2
Restore (kind of) default values for -fill and -outline in polygon items. Change star in canvas items demo (give it green outline without fill) to demonstrate why.
-rw-r--r--generic/tkCanvPoly.c5
-rw-r--r--library/demos/items.tcl2
2 files changed, 4 insertions, 3 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 03b3e57..a537846 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -113,15 +113,16 @@ static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
+ /* Remark: Default for -fill should be NULL, see [2860519]. Will be fixed in Tk 8.7 */
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL},
+ DEF_CANVITEM_OUTLINE, Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
"round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
{TK_CONFIG_COLOR, "-outline", NULL, NULL,
- DEF_CANVITEM_OUTLINE, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK, NULL},
+ NULL, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, outline.tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index bf54a89..aca37c2 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -94,7 +94,7 @@ $c create line 12c 6c 13.5c 4.5c 16.5c 7.5c 18c 6c \
$c create text 25c .2c -text Polygons -anchor n
$c create polygon 21c 1.0c 22.5c 1.75c 24c 1.0c 23.25c 2.5c \
- 24c 4.0c 22.5c 3.25c 21c 4.0c 21.75c 2.5c -fill $green \
+ 24c 4.0c 22.5c 3.25c 21c 4.0c 21.75c 2.5c -outline $green \
-width 4 -tags item
$c create polygon 25c 4c 25c 4c 25c 1c 26c 1c 27c 4c 28c 1c \
29c 1c 29c 4c 29c 4c -fill $red -outline {} -smooth on -tags item