Skip to content

Conversation

@rozele
Copy link
Contributor

@rozele rozele commented Jan 11, 2022

Description

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)

Why

There was a minor bug in the CalculationAnimationDriver that accounted for the value node offset when getting the start value for the animation. Animation drivers should always start from the raw value.

What

The fixes to change from animating the offset property to the value property (#9302) missed a minor bug in CalculatedAnimationDriver, where we start the animation from the Value of the animated value node rather than the RawValue. This generally won't cause any bugs for animations that do not use the Offset property (via setOffset), as in those cases Value == RawValue.

Testing

Re-ran RNTester NativeAnimated scenarios and they work as before (no change). Also verified that the native animation behavior diverged when using setOffset and no longer diverges with this fix.

Here's the before:

playground.2022-01-11.10-36-13.mp4

Here's the after:

playground.2022-01-11.10-37-55.mp4
Microsoft Reviewers: Open in CodeFlow

@rozele rozele requested a review from a team as a code owner January 11, 2022 15:10
@rozele rozele force-pushed the nativeAnimatedFix branch 2 times, most recently from c7c2020 to a43a80e Compare January 11, 2022 15:21
The fixes to change from animating the offset property to the value property
missed a minor bug in CalculatedAnimationDriver, where we start the animation
from the `Value` of the animated value node rather than the `RawValue`. This
generally won't cause any bugs for animations that do not use the `Offset`
property (via `setOffset`), as in those cases `Value` == `RawValue`.
@rozele rozele force-pushed the nativeAnimatedFix branch from a43a80e to 4b25c4b Compare January 11, 2022 15:22
@chiaramooney chiaramooney merged commit e1d8a70 into microsoft:main Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants