/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/renderer/graphics/BoxShadow.h
45 строк
1 KB
Nick Lefever
Move toDynamic conversion for BoxShadow (#52536)
10 июл 2025, 22:35
10 июл 2025, 22:35
0144798
Код
Авторство
О чём код?
/* * 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. */ #pragma once #include <react/renderer/graphics/Color.h> #include <react/renderer/graphics/Float.h> namespace facebook::react { struct BoxShadow { bool operator==(const BoxShadow& other) const = default; Float offsetX{}; Float offsetY{}; Float blurRadius{}; Float spreadDistance{}; SharedColor color{}; bool inset{}; #ifdef RN_SERIALIZABLE_STATE folly::dynamic toDynamic() const { folly::dynamic result = folly::dynamic::object(); result["offsetX"] = offsetX; result["offsetY"] = offsetY; result["blurRadius"] = blurRadius; result["spreadDistance"] = spreadDistance; result["color"] = *color; result["inset"] = inset; return result; } #endif }; #ifdef RN_SERIALIZABLE_STATE inline folly::dynamic toDynamic(const BoxShadow& boxShadow) { return boxShadow.toDynamic(); } #endif } // namespace facebook::react