Tk Source Code

View Ticket
Login
Ticket UUID: 2860519
Title: canvas polygon -fill default behavior wrong
Type: Bug Version: obsolete: 8.5.5
Submitter: blacksqr Created on: 2009-09-17 07:47:52
Subsystem: 05. Canvas Items Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2019-10-04 12:36:31
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2019-10-04 12:36:31
Description:
According to the canvas man page, drawing a polygon with option "-fill {}" is supposed to be equivalent to the default behavior (i.e. no fill).  However, when -fill option is not specified, the polygon is filled (incorrect); while when "-fill {}" is specified, the polygon is not filled (correct).

Example code:

package require Tk
canvas .c
.c create polygon 96 103 121 120 160 115 174 85 99 33 -outline black
pack .c
destroy .c
canvas .c
.c create polygon 96 103 121 120 160 115 174 85 99 33 -outline black -fill {}
pack .c

Tested on Ubuntu Hardy using ActiveTcl 8.5.5

same behavior in ver 8.4.19
User Comments: jan.nijtmans added on 2019-10-04 12:36:31:

Will be fixed in Tk 8.7.

*** POTENTIAL INCOMPATIBILITY ***

This means that polygons from now on have no -fill by default, only an outline. Most scripts use an explicit -fill, so those are only affected in a minor way (they become a little bit larger because of the border). But polygons without --fill will look completely different.

Compatibility note: If you want the old behavior, specify -fill _mycolor_ -outline {}


chrstphrchvz added on 2019-08-22 21:42:28:

There is a fix for this issue included as part of the patch I attached to [2beda171].