Join GitHub today
pygame.draw.ellipse does not draw ellipses with odd sizes #233
Steps to fix this issue of "pygame.draw.ellipse not being able to draw an odd sized ellipse".
Reported by Florian Krause on the pygame mailing list:
Code to reproduce:
The resulting ellipse will have a 4x4 size
Well here is a larger ellipse with a vertical line as visual aid.
Notice that the two ellipses have the same distance from the vertical line but the upper one should be one pixel larger (touching the line).
I drew two ellipses one with 20x20 and one with 21x21 size.
By looking at the code I understand why pygame draws two ellipses of identical size. What I don't understand is why we consider this okay.
I think if the API was draw.ellipse(center, x_radius, y_radius) you might have a point that we cannot have floating point radii but given the current API of draw.ellipse(x,y,w,h) I certainly would expect a result similar to the GIMP's output.