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

Re: [pygame] BUG: drawing thick circles



Indeed, I've seen this too. I was drawing arcs though, to make a 
dartboard. The thing about dartboards is that they are full of holes 
where previous darts have landed so the overall impression was 
much more realistic than I had hoped.

However, I did discover that by making tiny adjustments to the arc 
angles, and re-drawing the arc, most of the holes would get covered 
up. I guess you could try something similar with circles by drawing 
circles of very slightly differing sizes on top of each other.

The thing that got me on to Pygame in the first place was a much 
worse bug with arc drawing in wxpython. With that, a perfectly good 
10 degree arc would suddenly become a 350 degree arc as you 
draw it in a larger size. That was very nasty.

On 20 Jan 2005 at 15:03, Mark Wexler wrote:

> Hello, list. I seem to have found a bug in pygame.draw. When you draw a circle
> with a thick border, some pixels are left out. Here's a program that reproduces
> the bug:
> 
> -----------------
> import pygame
> L = 500
> 
> pygame.init()
> try:
>     surf = pygame.display.set_mode((L, L))
>     while True:
>         if pygame.event.peek((pygame.QUIT, pygame.KEYDOWN)): break
>         surf.fill((128, 255, 128))
>         pygame.draw.circle(surf, 0, (L/2, L/2), L/3, 20)
>         pygame.draw.line(surf, 0, (0.1*L, 0.5*L), (0.9*L, 0.5*L), 20)
>         pygame.display.flip()
> finally:
>     pygame.quit()
> -----------------
> 
> As you can see, some pixels are left out of the thick circle, but not out of the
> thick line. I found this bug on a WinXP machine (btw, I have pygame 1.6.2,
> Python 2.3.4), but I've reproduced it a machine running Linux.
> 
> Has anyone come across this before? Is there a quick fix? Am I missing something?
> 
> Thanks a lot!
> 
> Mark
> 
> 
> 

-- 
Regards
Ben Friman
t 0870 041 0935
w www.learntotype.com