mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-22 19:48:56 +08:00
Fabric: borderWidths field was removed from ViewProps
Summary: @public Apperently, we don't need to store and parse this because we are already doing this for `yogaStyle` field. Reviewed By: sahrens Differential Revision: D9649549 fbshipit-source-id: a84a5518674f4c2d574a060cdbebb9562121f5f4
This commit is contained in:
committed by
Facebook Github Bot
parent
2caa1e01fa
commit
2c3e4ec06b
@@ -25,7 +25,6 @@ ViewProps::ViewProps(const ViewProps &sourceProps, const RawProps &rawProps):
|
||||
opacity(convertRawProp(rawProps, "opacity", sourceProps.opacity, (Float)1.0)),
|
||||
foregroundColor(convertRawProp(rawProps, "foregroundColor", sourceProps.foregroundColor)),
|
||||
backgroundColor(convertRawProp(rawProps, "backgroundColor", sourceProps.backgroundColor)),
|
||||
borderWidths(convertRawProp(rawProps, "border", "Width", sourceProps.borderWidths)),
|
||||
borderRadii(convertRawProp(rawProps, "border", "Radius", sourceProps.borderRadii)),
|
||||
borderColors(convertRawProp(rawProps, "border", "Color", sourceProps.borderColors)),
|
||||
borderStyles(convertRawProp(rawProps, "border", "Style", sourceProps.borderStyles)),
|
||||
@@ -44,6 +43,18 @@ ViewProps::ViewProps(const ViewProps &sourceProps, const RawProps &rawProps):
|
||||
#pragma mark - Convenience Methods
|
||||
|
||||
BorderMetrics ViewProps::resolveBorderMetrics(bool isRTL) const {
|
||||
auto borderWidths = CascadedBorderWidths {
|
||||
.left = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeLeft]),
|
||||
.top = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeTop]),
|
||||
.right = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeRight]),
|
||||
.bottom = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeBottom]),
|
||||
.start = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeStart]),
|
||||
.end = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeEnd]),
|
||||
.horizontal = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeHorizontal]),
|
||||
.vertical = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeVertical]),
|
||||
.all = optionalFloatFromYogaValue(yogaStyle.border[YGEdgeAll])
|
||||
};
|
||||
|
||||
return {
|
||||
.borderColors = borderColors.resolve(isRTL, {}),
|
||||
.borderWidths = borderWidths.resolve(isRTL, 0),
|
||||
|
||||
Reference in New Issue
Block a user