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

[pygame] BUG: drawing thick circles



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