Skip to content

Artifact when rectangle with rounded corners #3106

Open
@Nikolasitude

Description

@Nikolasitude

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intendeddrawpygame.draw

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions