Python turtlegraphics mismatch between different OS

I am drawing a fairly simple form using the Python module turtleand code below:

import turtle

turtle.color('black', '#fef00e')
turtle.begin_fill()
turtle.left(180)
turtle.forward(100)
for i in range(5):
    turtle.right(90)
    turtle.forward(100+50*i)
turtle.end_fill()
turtle.done()

Oddly enough, this gives two different results in Windows (left) and in all other OSes that I tried (Ubuntu, Arch, OSX). Areas with an even number of overlapping fillings still fill in on Windows, but close again for others. Can someone explain to me what is the reason for this, and is there any way to influence it? It seems strange that such a behavior would be so inconsistent.

enter image description here enter image description here

It seems like a design choice; It does not seem immediately obvious to me which of the two is the β€œcorrect” version.

+4
source share
1

, "" "" " " . - . , . ( " ".) Tkinter. Tkinter, Windows ( , ). , * nix ( ).

from tkinter import *
root = Tk()
canv = Canvas(root, width=800, height=800)
canv.pack()
l = canv.create_polygon(
        500,400, 400,400, 400,300, 550,300,
        550,500, 300,500, 300,200, 500,400, fill='yellow')
root.mainloop()

, , - "".

tk manual, , '-fill color'.

+1
source

Source: https://habr.com/ru/post/1614572/


All Articles