PencilCode / jquery-turtle

Turtle Graphics for JQuery
Other
44 stars 25 forks source link

Fix 'stop button' flashing by tracking setTimeouts. #49

Closed davidbau closed 10 years ago

davidbau commented 10 years ago

The interrupt('test') flag that is used to by the IDE to determine whether the 'stop' button should show used to be able to return 'false' if the only pending animation was a setTimeout(fn, 0) caused by an async continuation callback. The result would be that the "stop" button would flash (incorrectly) in a program that uses a continuation-callback in a loop.

This change tracks those async delays and allows interrupt('test') to stay "true" in those cases, so that the "stop" button is steady.

dabbler0 commented 10 years ago

Looks good to me.