react-native-macos/Libraries/Animated/nodes
Eric Rozell fe53cae954 Deduct offset from `getValue` result when detaching
Summary:
The NativeAnimated `getValue` API returns `value + offset`:
Android:
iOS: https://github.com/facebook/react-native/blob/main/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.m#L44
Android: https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java#L36

When we store the value after detaching the NativeAnimated node, it stores the result of the NativeAnimated `getValue` call to the `_value` property, so if we call `__getValue` at some later point on the `AnimatedValue`, we will count the offset twice.

This change deducts the offset value from the result returned from `getValue` when storing the latest value.

Changelog:
[General][Fixed] - AnimatedValue.__detach should store getValue result with offset deducted

Reviewed By: yungsters

Differential Revision: D32987003

fbshipit-source-id: 488d1fe512f886c7a9de1e5a4de8f19441ebd81e
2021-12-10 08:07:38 -08:00
..
AnimatedAddition.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedDiffClamp.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedDivision.js Animated: Early detection of division by zero in AnimatedDivision 2020-09-26 17:23:15 -07:00
AnimatedInterpolation.js Add LTI annotations to xplat/js 2021-11-10 15:40:15 -08:00
AnimatedModulo.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedMultiplication.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedNode.js Fix reference URLs in Animated 2021-11-17 20:35:19 -08:00
AnimatedProps.js Animated: Decouple `__attach` from `new AnimatedProps` 2021-05-10 17:02:59 -07:00
AnimatedStyle.js Add LTI annotations to xplat/js 2021-11-10 15:40:15 -08:00
AnimatedSubtraction.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedTracking.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedTransform.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedValue.js Deduct offset from `getValue` result when detaching 2021-12-10 08:07:38 -08:00
AnimatedValueXY.js Fix reference URLs in Animated 2021-11-17 20:35:19 -08:00
AnimatedWithChildren.js pre-suppress Flow errors in xplat ahead of 153 release 2021-06-01 09:01:26 -07:00