You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the iterationCount variable (field) is missing in the animationiteration event. In some cases - especially when the iteration-count is significant, we might know the exact value: which iteration happens currently.
Simple sample here: https://jsfiddle.net/utasir/4wn52fdo/
In this testcase I had to use a "global" variable to count the iteration, but this sounds as a hack.
Here are the fields, what we have currently in the event object:
So, my suggestion is: adding a new field which shows the current iteration number.
The text was updated successfully, but these errors were encountered:
This seems like a very reasonable suggestion with a clear use case (and happens to be easy to implement).
For the name I'm afraid that iterationCount might sound too similar to animation-iteration-count and could be confused as representing the total number of iterations. Perhaps currentIteration? elapsedIterations?
With the animation now being passed into the event (see resolution), I think it’s best to add this to the Animation object instead of the event so that it can be used in more than just the animationIteration event.
As for naming this: currentIteration as a name takes my preference, as an author most likely wants to know the current iteration count instead of previous (elapsed) count. Also fine with currentIterationCount, which is even more expressive of what it is about.
I don't think this should be added to the Animation object. It's a property of an animation effect (assuming there is one) and I don't think we want to lift all the timing properties from the root animation effect to the Animation.
Also, the value in the event should a static snapshot of the iteration count at the time the event was triggered, not the current live value.
If the authors wants the live value they can fetch it in the same way they fetch the live progress, i.e. animation.effect?.getComputedTiming().currentIteration.
Currently the iterationCount variable (field) is missing in the animationiteration event. In some cases - especially when the iteration-count is significant, we might know the exact value: which iteration happens currently.
Simple sample here: https://jsfiddle.net/utasir/4wn52fdo/
In this testcase I had to use a "global" variable to count the iteration, but this sounds as a hack.
Here are the fields, what we have currently in the event object:
So, my suggestion is: adding a new field which shows the current iteration number.
The text was updated successfully, but these errors were encountered: