Files
react-native/ReactCommon/fabric/components/art/text/ARTTextProps.cpp
T
David Vacca b8b683dc46 Serialize ART text components and send data to Android
Summary:
This diff implements the serialization of Text components to send data from C++ to java

changelog: [Internal] internal changes to support ART in fabric

Reviewed By: JoshuaGross

Differential Revision: D21681875

fbshipit-source-id: eba31f35c95e0a2d3226ec70421832719083d7fa
2020-05-22 01:23:36 -07:00

50 lines
1.6 KiB
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <react/components/art/ARTTextProps.h>
#include <react/core/propsConversions.h>
namespace facebook {
namespace react {
ARTTextProps::ARTTextProps(
const ARTTextProps &sourceProps,
const RawProps &rawProps)
: Props(sourceProps, rawProps),
opacity(convertRawProp(rawProps, "opacity", sourceProps.opacity, {1.0})),
transform(
convertRawProp(rawProps, "transform", sourceProps.transform, {})),
d(convertRawProp(rawProps, "d", sourceProps.d, {})),
stroke(convertRawProp(rawProps, "stroke", sourceProps.stroke, {})),
strokeDash(
convertRawProp(rawProps, "strokeDash", sourceProps.strokeDash, {})),
fill(convertRawProp(rawProps, "fill", sourceProps.fill, {})),
strokeWidth(convertRawProp(
rawProps,
"strokeWidth",
sourceProps.strokeWidth,
{1.0})),
strokeCap(
convertRawProp(rawProps, "strokeCap", sourceProps.strokeCap, {1})),
strokeJoin(
convertRawProp(rawProps, "strokeJoin", sourceProps.strokeJoin, {1})),
alignment(
convertRawProp(rawProps, "alignment", sourceProps.alignment, {})),
frame(convertRawProp(rawProps, "frame", sourceProps.frame, {})){};
#pragma mark - DebugStringConvertible
#if RN_DEBUG_STRING_CONVERTIBLE
SharedDebugStringConvertibleList RawTextProps::getDebugProps() const {
return {debugStringConvertibleItem("opacity", opacity)};
}
#endif
} // namespace react
} // namespace facebook