pygame-community / pygame-ce

🐍🎮 pygame - Community Edition is a FOSS Python library for multimedia applications (like games). Built on top of the excellent SDL library.
https://pyga.me
930 stars 154 forks source link

Artifact when rectangle with rounded corners #3106

Open Nikolasitude opened 2 months ago

Nikolasitude commented 2 months ago

Environment:

pygame-ce 2.5.0 (SDL 2.30.3, Python 3.12.1)

Current behavior:

The bug manifests when 2 conditions are met :

The bug consists of a rectangle that appears in front of the first rectangle.

Test code

from pygame import *
from time import sleep

init()

_window = display.set_mode((960,540), 16)

for x in range(100):
    x = x%20
    _window.fill((0,0,0))
    draw.rect(_window, (200,200,200), [50,50,100,20], x, 1)
    draw.rect(_window, (200,200,200), [180,50,100,20], 17, x)

    draw.rect(_window, (200,200,200), [50,200,100,50], 17, x)
    draw.rect(_window, (200,200,200), [180,200,100,35], 17, x)

    draw.rect(_window, (200,200,200), [50,350,100,35], x, 1)

    display.update()
    sleep(0.1)
bilhox commented 2 months ago

I feel like this issue is similar to this problem : #2285