fixed? weird animation looping

I think this fixes the weird animation looping...
not sure if it's the correct solution, but I tested a bunch of projects
and demos with it. they all look correct to me.
closes #959