Skip to content

Fix polygon outline that shouldn't be displayed when epaisseur=0

Aodren Commun requested to merge (removed):master into master

Before this patch, the polygon function would draw a black outline even if the epaisseur parameter is set to 0.

For example :

import fltk

fltk.cree_fenetre(500, 500)
fltk.rectangle(0, 0, fltk.largeur_fenetre(), fltk.hauteur_fenetre(), remplissage='#DDDDDD')

fltk.rectangle(60, 60, 160, 160, remplissage='white', epaisseur=0)
fltk.polygone([(250, 60), (350, 60), (350, 160), (300, 110), (250, 160)], remplissage='white', epaisseur=0)
fltk.cercle(150, 300, 70, remplissage="white", epaisseur=0)

fltk.attend_fermeture()

The code above would produce this result :

Capture d’écran 2023-11-24 à 15.52.38.png

It now performs as expected :

Capture d’écran 2023-11-24 à 15.53.00.png

This was due to the default value of the parameter couleur ("black") being passed to tkinter even when epaisseur was 0.

Edited by Aodren Commun

Merge request reports

Loading