This repository was archived by the owner on Aug 30, 2023. It is now read-only.
Ensure that non-additive animations begin from the presentation layer state when beginFromCurrentState is enabled #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When beginFromCurrentState is enabled, the user expects any new animations to animate from the layer's current presentation state.
What this actually means in practice depends on whether the new animation is additive or not.
If the animation is additive, we always want to read from the model layer because we need to calculate displacement from the old destination to the new destination.
If the animation is not additive, we read from the presentation layer if available so that the view begins animating from its current rendered position.
The difference between the two approaches is that additive animations will always appear to preserve momentum - potentially even moving in the opposite direction for a brief moment - while non-additive animations will instantly begin moving toward the new destination.