/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/renderer/animated/nodes/DivisionAnimatedNode.cpp
37 строк
912 B
Samuel Susla
Move C++ Animated to ReactCommon (#53278)
18 авг 2025, 14:13
18 авг 2025, 14:13
3a3e3b8
Код
Авторство
О чём код?
/* * 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