From 3e9e8109c9b41ff279e6cb4f971e84e4f636eeb5 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Sat, 30 Mar 2013 22:09:30 +0100 Subject: [PATCH] clock: improve accuracy of the clock scheduler. Animatino of 1/60 fps run without dropping any frames. --- kivy/clock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kivy/clock.py b/kivy/clock.py index dfbc531fb..2de337a65 100644 --- a/kivy/clock.py +++ b/kivy/clock.py @@ -255,8 +255,9 @@ class ClockEvent(object): self.callback = None def tick(self, curtime): - # timeout happen ? - if curtime - self._last_dt < self.timeout: + # timeout happened ? (check also if we would miss from 5ms) + # this 5ms increase the accuracy if the timing of animation for example. + if curtime - self._last_dt < self.timeout - 0.005: return True # calculate current timediff for this event