Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact when rectangle with rounded corners #3106

Open
Nikolasitude opened this issue Sep 16, 2024 · 1 comment
Open

Artifact when rectangle with rounded corners #3106

Nikolasitude opened this issue Sep 16, 2024 · 1 comment
Labels
bug Not working as intended draw pygame.draw
Milestone

Comments

@Nikolasitude
Copy link

Nikolasitude commented Sep 16, 2024

Environment:

pygame-ce 2.5.0 (SDL 2.30.3, Python 3.12.1)

Current behavior:

The bug manifests when 2 conditions are met :

  • When a value is given to make pygame.rect’s borders rounder (give it any positive number)
  • When the rectangle has a height or a weight so little the the borders touch

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)
@Nikolasitude Nikolasitude added the bug Not working as intended label Sep 16, 2024
@bilhox
Copy link
Contributor

bilhox commented Sep 16, 2024

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

@bilhox bilhox added draw pygame.draw labels Sep 16, 2024
@bilhox bilhox added this to the 2.5.3 milestone Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended draw pygame.draw
Projects
None yet
Development

No branches or pull requests

2 participants