mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51615 changelog: [internal] rename methods to reflect that they are getters and mark them as noexcept const Reviewed By: rshest Differential Revision: D75217535 fbshipit-source-id: c7d77060d0f54f8043a7552eec7e2b231cb5b7bf
38 lines
912 B
C++
38 lines
912 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
/*
|
|
* Adapted from react-native-windows under the MIT license.
|
|
*/
|
|
|
|
#include "DivisionAnimatedNode.h"
|
|
|
|
#include <react/debug/react_native_assert.h>
|
|
#include <react/renderer/animated/NativeAnimatedNodesManager.h>
|
|
|
|
namespace facebook::react {
|
|
|
|
void DivisionAnimatedNode::update() {
|
|
auto rawValue = 0.0;
|
|
int count = 0;
|
|
for (const auto tag : inputNodes_) {
|
|
const auto node = manager_->getAnimatedNode<ValueAnimatedNode>(tag);
|
|
react_native_assert(
|
|
node && "Invalid node tag set as input for DivisionAnimatedNode");
|
|
if (count == 0) {
|
|
rawValue = node->getValue();
|
|
} else {
|
|
rawValue /= node->getValue();
|
|
}
|
|
|
|
count++;
|
|
}
|
|
setRawValue(rawValue);
|
|
}
|
|
|
|
} // namespace facebook::react
|