[Sugar-devel] [Dextrose] [PATCH v4 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
bernie at codewiz.org
Mon Oct 11 15:11:01 EDT 2010
On Tue, 2010-10-12 at 05:42 +0530, Anurag Chowdhury wrote:
> diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py
> index 8fb298b..e3a3503 100644
> --- a/src/sugar/graphics/animator.py
> +++ b/src/sugar/graphics/animator.py
> @@ -136,7 +136,7 @@ class Animation(object):
> start = self.start
> change = self.end - self.start
> - if t == duration:
> + if fps < 20:
> # last frame
> frame = self.end
1) Where does this magic number 20 come from?
2) Isn't "fps" the *desired* frame-rate set by client code when creating
the Animator instance?
3) The variable fps isn't even available within the Animator.do_frame().
Are you familiar with variable scoping OOP languages?
4) The patch isn't *adding* the check, it's *replacing* the existing
check to terminate the animation normally.
5) Finally, have you executed Sugar at least once with the patch applied
to check that it fixes the bug without introducing new problems? Because
of (3), it will simply cause an exception. Even if it worked, it would
make Sugar skip all animations at <20fps and turn all the others into
infinite loops, which is hardly the desired effect.
I recommend switching to an easier bug.
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/
More information about the Sugar-devel