etxztn / pulpcore

Automatically exported from code.google.com/p/pulpcore
0 stars 0 forks source link

Sprite.visible.set(false) shouldn't repaint the sprite #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Sprite 
2. make it invisible
3. make it visible again

What is the expected output? What do you see instead?
The sprite is updated twice. We could expect that it will be updated only
once when the Sprite is made visible again (step 3). We shouldn't waste
time updating a Sprite that doesn't show on the screen. 

Original issue reported on code.google.com by florent....@gmail.com on 5 Apr 2009 at 4:35

GoogleCodeExporter commented 8 years ago
Hmm, I'm not following this one exactly. Maybe a code example would help?

Invisible sprites need their update() method called so that their properties 
are updated - updated properties may 
cause the sprite to become visible again. Also, when changing the visible 
property, the sprite is marked as dirty 
so that it's dirty rectangle will be redrawn.

Original comment by brack...@gmail.com on 5 Apr 2009 at 5:31

GoogleCodeExporter commented 8 years ago
I was wondering about the need to redraw the sprite if it's actually not 
visible.

Changing a sprite from invisible to visible will need a redraw, ok.
but changing a visible sprite to invisible should not need one.

I used the  term "update" but I was talking about the redraw stuff, especially 
the
drawSprite() method.

Original comment by florent....@gmail.com on 5 Apr 2009 at 5:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
As far as I can tell, drawSprite() is not called on invisible sprites. If 
drawSprite() is called, it's a bug.
When a sprite is set to invisible, its dirty rectangle is updated to make sure 
what is underneath the sprite is 
redrawn.

Original comment by brack...@gmail.com on 5 Apr 2009 at 5:51

GoogleCodeExporter commented 8 years ago

Original comment by brack...@gmail.com on 11 Apr 2009 at 12:41