Files
react-native/packages/react-native/ReactCxxPlatform/react/renderer/animated/nodes/ModulusAnimatedNode.cpp
T
Samuel SuslaandFacebook GitHub Bot 310bd4e5bb Back out "move C++ Animated to ReactCommon" (#52984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52984

changelog: [internal]

breaks Github CI, let's back it out for now.

Original commit changeset: 141f0ce7b993

Original Phabricator Diff: D79184118

Reviewed By: rubennorte

Differential Revision: D79444246

fbshipit-source-id: 8aa35ed450804c77389601a4ea820b1dd552ad98
2025-08-01 10:10:10 -07:00

34 lines
915 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 "ModulusAnimatedNode.h"
#include <react/renderer/animated/NativeAnimatedNodesManager.h>
namespace facebook::react {
ModulusAnimatedNode::ModulusAnimatedNode(
Tag tag,
const folly::dynamic& config,
NativeAnimatedNodesManager& manager)
: ValueAnimatedNode(tag, config, manager),
inputNodeTag_(static_cast<Tag>(getConfig()["input"].asInt())),
modulus_(getConfig()["modulus"].asDouble()) {}
void ModulusAnimatedNode::update() {
if (const auto node =
manager_->getAnimatedNode<ValueAnimatedNode>(inputNodeTag_)) {
setRawValue(std::fmod(node->getValue(), modulus_));
}
}
} // namespace facebook::react