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
Is there a general way to set/update the initialComputedStyle for a Sprite? I noticed some methods like startAtSprite affect it.
In general I'm having trouble using applyStyles throughout my transition, but I think my mental model for it might be off. I would expect to be able to do something like
Yes, we should clarify the mental model because it's not what you're describing.
initialComputedStyle and finalComputedStyle are not things we are free to change. They're supposed to reflect the true state of the app before and after the animation, and animations are not allowed to alter that.
applyStyles always take temporary effect. It can apply whatever it wants to, but that only matters during the animation, and at the end we will still go back to whatever we were going to have if there had been no animation at all.
It's fine to use applyStyles at the start of a transition, but that's still inside the transition. You aren't altering the initialComputedStyle, because that measures the world before there was any transition at all.
Motions really shouldn't try to measure anything about the DOM, including computed styles. Firstly because they can't accurately because what they see is being tainted by other motions. And second because it's easy to accidentally cause layout thrashing if motions are both reading and writing DOM. So a motion like adjustCSS isn't looking at the current state of the Element to decide a start point, it's looking at initialComputedStyle and finalComputedStyle, which the library has already measured for us at the points in time where those things are actually measurable.
I think I might be misunderstanding the intended use for
applyStyles
Is there a general way to set/update the
initialComputedStyle
for a Sprite? I noticed some methods likestartAtSprite
affect it.In general I'm having trouble using
applyStyles
throughout my transition, but I think my mental model for it might be off. I would expect to be able to do something likeand have it fade in.
The text was updated successfully, but these errors were encountered: