LayeredUpdates.draw() returns a list with many rect(0,0,0,0)

Issue #88 resolved
Former user created an issue

I didn't find any information on this issue, sorry if it has been created before.

in pygame 1.9.2

LayeredUpdates.draw() seems to return a rect(0,0,0,0) if sprites are side to side. I made a quick test with two sprites next to each other, here's the list LayeredUpdates.draw() returned :

{{{ #!python [<rect(20, 644, 84, 120)>, <rect(0, 0, 0, 0)>, <rect(104, 644, 84, 120)>, <rect(0, 0, 0, 0)>] }}}

In the game I'm making i have 12*12cells , with a sprite in each and I get 287 rects...

Comments (9)

  1. DR0ID

    This should only occur on the very first draw call or once for each newly added sprite. This is intentional to avoid to have a special case like the other groups ( self.spritedict[sprite] = 0). Take a look at line 571.

    There is code attached that demonstrates that behavior.

    Due to that, the LayeredUpdate.draw method could be changed as in the attachment.

  2. René Dudfield


    @dr0id: does the contain a bug fix we should apply? Or is it showing why the code acts as it is?

  3. Jason Marshall

    dr0id's attached is almost exactly the same as 1.9.1's It does not fix this issue.

  4. Log in to comment