-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
pygame.draw.ellipse
behaves inconsistently when provided rect width
or height
are negative
#2727
Comments
I'm trying to see if I can fix this, for me it gave me the same problem as you reported. |
So, is the negative value really necessary? I think there is no need for a negative value. And in the #Normal annotation you are superimposing the red color on top of the dark gray |
I think the solution I would prefer to go with is to just disallow negative rect width and negative rect height here. That scenario doesn't really make any sense anyway IMO and I don't know what the "best" solution would be here. A rect constructed from (50, 50, -50, -50) for example is supposed to have it's top-left corner at (50, 50). But, with a width and height of -50, the only reasonable way I can interpret that is "go 50 pixels left and 50 pixels up to get the bottom right corner relative to the top left corner". A better way to get that IMO would be just to create the rect (0, 0, 50, 50) |
I agree |
Marking this as a good first issue. Things to do to resolve this
|
i dont like the idea of raising exception in this case such rects can pop up as result of some complicated calculations, and such random exception might be surprising on the other side, pep20 says that errors should never pass silently |
I want to try to solve this problem. I'm going to do it using Linux on an old pc that I'm installing |
Environment:
pygame-ce 2.4.1 (SDL 2.28.5, Python 3.12.0)
:Current behavior:
Consider this code:
When I run it I see this:
2/3 weird circles are not draws (its ok), one of them is drawn to the left and is filled.
If I do not provide
width=1
, then same issue appears:Expected behavior:
Either all weird-circles are draw, or none of them.
The text was updated successfully, but these errors were encountered: