Hello,
I have an animation where several elements move synchronously to a random position. To ensure that they both receive the same random value, I generate it in onRepeat.
I want to make the animation adaptive. If you change the screen width now, you will notice how the elements "jump" to new position. To fix this, I assume that when resizing, the updateX function should use the old random value. However, for some reason, onRepeat is triggered during every tick of the resize event, and I don't understand how to determine when to update the lastRand value and when to use the old one.