-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Make withDecay
compatible with withRepeat
#6772
Merged
patrycjakalinska
merged 9 commits into
main
from
@patrycjakalinska/withdecay-withrepeat-compatibility
Jan 30, 2025
Merged
fix: Make withDecay
compatible with withRepeat
#6772
patrycjakalinska
merged 9 commits into
main
from
@patrycjakalinska/withdecay-withrepeat-compatibility
Jan 30, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patrycjakalinska
changed the base branch from
main
to
@patrycjakalinska/with-decay-never-start-issue
November 28, 2024 12:59
patrycjakalinska
changed the base branch from
@patrycjakalinska/with-decay-never-start-issue
to
main
December 16, 2024 10:35
tjzel
reviewed
Dec 24, 2024
piaskowyk
requested changes
Jan 2, 2025
piaskowyk
approved these changes
Jan 29, 2025
patrycjakalinska
deleted the
@patrycjakalinska/withdecay-withrepeat-compatibility
branch
January 30, 2025 07:40
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
As it was discovered in #6757,
withRepeat
run along withwithDecay
triggered repeat only once, even if the number of repeats was greater.withDecay
relies on the value ofvelocity
. TheinitialVelocity
is the velocity provided (or default), and during the animation, thevelocity
value decreases, causing the animated object to slowly stop. The problem was, after first repeat thevelocity
was already decreased to almost zero and the animation could not run, as it had no momentum.I was able to fix that by adjusting
finished
prop, and resetingvelocity
to initial value, iffinished
istrue
.Fixes #6757
Before:
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-11-25.at.12.07.07.mp4
After:
Screen.Recording.2024-11-28.at.14.18.54.mov
Test plan
Run provided code snipped on Fabric example
Code snipped provided in issue