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

RE: [pygame] Maybe a bug in pygame.draw.circle?



> -----Original Message-----
> From: owner-pygame-users@xxxxxxxx [mailto:owner-pygame-users@xxxxxxxx] On
> Behalf Of Lenard Lindstrom
> Sent: Thursday, May 01, 2008 10:38 AM
> To: pygame-users@xxxxxxxx
> Subject: Re: [pygame] Maybe a bug in pygame.draw.circle?
> 
> Hugo Ruscitti wrote:
> > Hi, we found a posible bug in "pygame.draw.circle" function using
> > pygame1.8 (we don't try with
> > other versions).
> >
> > When we set a circle border, the "pygame.draw.circle" function puts
> > some little pixels
> > like noise. This is a screenshot of the posible bug:
> >
> >
> http://www.losersjuegos.com.ar/incoming/descargas/20080501/circle_border.p
> ng
> >
> > and this is a sample code:
> >
> > --- %< ---
> > import pygame
> >
> > WHITE = (255, 255, 255)
> > position = 100, 100
> > screen = pygame.display.set_mode((320, 240))
> >
> > pygame.draw.circle(screen, WHITE, position, 50, 20)
> > pygame.display.flip()
> > pygame.time.wait(1000)
> > --- %< ---
> >
> > note that when remove the 50 value of border, the circle will draw fine:
> >
> >
> http://www.losersjuegos.com.ar/incoming/descargas/20080501/circle_fill.png
> >
> > Thanks!
> >
> >
> This is because a thick circle is created by drawing a series of single
> pixel-width circles. I don't know what can be done about this.
> 
> --
> Lenard Lindstrom
> len-l@xxxxxxxxx

Well, I would think the right way to fix it would be to create a
"draw_donut" or something similar that adapts the ellipse drawing code to do
the right thing.

Out of curiosity, is there a good reason why pygame has it's own set of
graphic primitive drawing functions in draw.c instead of using SDL_gfx:
http://www.ferzkopp.net/joomla/content/view/19/14/
?

---------
John Krukoff
helot@xxxxxxxxxxx