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

Re: [pygame] BUG: pygame.draw.arc



Peter Shinners wrote:

On Wed, 2006-08-02 at 22:03 +1000, Alex Holkner wrote:


If a start angle of 0 or math.pi*3/2 is given, the returned update rectangle does not include the right-most (for angle 0) or bottom-most (for angle pi*3/2) pixel. Other start angles, with arcs that cover those same pixels, work correctly, as do end angles at those points.



Hmm, do you have any guesses why? The arc drawing was all contributed
code that I'm not framiliar with. If it is something simple like
rounding I could probably tweak it a little. It would take me some time
to get into the actual logic of it.


Afraid not, I had a look for a few minutes but could see no reason; it seems to apply the same trig operations to each point regardless of whether it is start or end. Internally it calls the line drawing function between each calculated pixel (yikes!), so possibly something is going wrong there.

The arc code in pygame-ctypes (nearly working) uses a different algorithm.

Alex.