[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Odd size circles?



John Eriksson wrote:
Hi,

It doesn't seem to be possible to draw circles with a uneven diameter.

I tried to use pygame.draw.ellipse but that couldn't draw circles with
an uneven diameter either.

Is this a limit in pygame or sdl??

PyGame. The circle/ellipse algorithm uses integer arithmetic on the radius. The arc function uses a far more naive trig approach though, which should have no problem with non-integer radii (PyGame casts the incoming rectangle to an int, though, which is easily patchable, or you could copy the code from Pygame-ctypes).

Alex.