diff --git a/change/react-native-windows-b50197bd-a2bb-423e-a088-a65afa8f7969.json b/change/react-native-windows-b50197bd-a2bb-423e-a088-a65afa8f7969.json new file mode 100644 index 00000000000..93d57c2b523 --- /dev/null +++ b/change/react-native-windows-b50197bd-a2bb-423e-a088-a65afa8f7969.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Use raw value for CalculatedAnimationDriver", + "packageName": "react-native-windows", + "email": "erozell@outlook.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp b/vnext/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp index a675d96d567..e673ed6f5e1 100644 --- a/vnext/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp +++ b/vnext/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp @@ -18,7 +18,7 @@ std::tuple CalculatedA compositor.CreateLinearEasingFunction()); }(); - m_startValue = GetAnimatedValue()->Value(); + m_startValue = GetAnimatedValue()->RawValue(); std::vector keyFrames = [this]() { std::vector keyFrames; bool done = false; @@ -37,7 +37,7 @@ std::tuple CalculatedA std::chrono::milliseconds duration(static_cast(keyFrames.size() / 60.0f * 1000.0f)); animation.Duration(duration); auto normalizedProgress = 0.0f; - auto fromValue = static_cast(GetAnimatedValue()->RawValue()); + auto fromValue = static_cast(m_startValue); animation.InsertKeyFrame(normalizedProgress, fromValue, easingFunction); for (const auto keyFrame : keyFrames) { normalizedProgress = std::min(normalizedProgress + 1.0f / keyFrames.size(), 1.0f);