mirror of https://github.com/kivy/kivy.git
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:
parent
df6b7c2335
commit
d7c2dbed92
|
@ -222,8 +222,11 @@ class WindowPygame(WindowBase):
|
||||||
Clock.unschedule(cb)
|
Clock.unschedule(cb)
|
||||||
Clock.schedule_once(cb, .1)
|
Clock.schedule_once(cb, .1)
|
||||||
|
|
||||||
|
elif event.type == pygame.VIDEOEXPOSE:
|
||||||
|
self.canvas.ask_update()
|
||||||
|
|
||||||
# ignored event
|
# ignored event
|
||||||
elif event.type in (pygame.ACTIVEEVENT, pygame.VIDEOEXPOSE):
|
elif event.type == pygame.ACTIVEEVENT:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# unhandled event !
|
# unhandled event !
|
||||||
|
|
|
@ -68,7 +68,7 @@ cdef class Instruction:
|
||||||
|
|
||||||
property needs_redraw:
|
property needs_redraw:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return bool(self.flags | GI_NEEDS_UPDATE)
|
return bool(self.flags & GI_NEEDS_UPDATE)
|
||||||
|
|
||||||
|
|
||||||
cdef class InstructionGroup(Instruction):
|
cdef class InstructionGroup(Instruction):
|
||||||
|
|
Loading…
Reference in New Issue