graphics: fix needs_redraw + properly handle videoexpose event to update canvas. Closes #28

(now drawing happen only when needed. carefully check for any bugs !!!)
This commit is contained in:
Mathieu Virbel 2011-04-20 02:38:05 +02:00
parent df6b7c2335
commit d7c2dbed92
2 changed files with 5 additions and 2 deletions

View File

@ -222,8 +222,11 @@ class WindowPygame(WindowBase):
Clock.unschedule(cb)
Clock.schedule_once(cb, .1)
elif event.type == pygame.VIDEOEXPOSE:
self.canvas.ask_update()
# ignored event
elif event.type in (pygame.ACTIVEEVENT, pygame.VIDEOEXPOSE):
elif event.type == pygame.ACTIVEEVENT:
pass
# unhandled event !

View File

@ -68,7 +68,7 @@ cdef class Instruction:
property needs_redraw:
def __get__(self):
return bool(self.flags | GI_NEEDS_UPDATE)
return bool(self.flags & GI_NEEDS_UPDATE)
cdef class InstructionGroup(Instruction):