mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
888866461b
Summary: This diff refactors the types of ART Text classes, this is necessary on the next diffs of the stack closeoncommit changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D21681876 fbshipit-source-id: ea438e89df6d860b3ff8bbdae657ca123b417a1b
53 lines
1.7 KiB
C++
53 lines
1.7 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})),
|
|
aligment(convertRawProp(
|
|
rawProps,
|
|
"aligment",
|
|
sourceProps.aligment,
|
|
{ARTTextAlignment::Default})),
|
|
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
|