Export to GitHub

cakejs - issue #6

after(1000) can fire before after(900)


Posted on Mar 15, 2008 by Helpful Kangaroo

What steps will reproduce the problem? 1. after(1000, function(){ console.log("1000") }) 2. after(900, function(){ console.log("900") }) 3. after(0, function(){ do_stuff_for_2000ms(); })

What is the expected output?

900 1000

What do you see instead?

1000 900

This happens because the animation methods use a frame handler per animation method call.

Fixable by moving to a timeline minheap and popping the callbacks from it. (I.e. have a timeline, call and remove the earliest event from the timeline while the earliest event in the timeline <= current time.)

Comment #1

Posted on Mar 17, 2008 by Helpful Kangaroo

should be fixed in r8, moved to timeline system.

Status: Fixed

Labels:
Type-Defect Priority-Medium