Fabric: Stripping the word `fabric` from some function names

Summary:
@public
Trivial.
We should not use the name of the effort in the API interfaces where it's not neccecery.

Reviewed By: sahrens

Differential Revision: D9652991

fbshipit-source-id: 52b99e39f92926f9fc99626690eb4385195558f6
This commit is contained in:
Valentin Shergin 2018-09-07 23:38:55 -07:00 committed by Facebook Github Bot
parent ff1b950e29
commit 1e3e2387d3
2 changed files with 29 additions and 29 deletions

View File

@ -18,7 +18,7 @@
namespace facebook {
namespace react {
inline Float fabricFloatFromYogaFloat(float value) {
inline Float floatFromYogaFloat(float value) {
if (value == YGUndefined) {
return kFloatUndefined;
}
@ -26,7 +26,7 @@ inline Float fabricFloatFromYogaFloat(float value) {
return (Float)value;
}
inline float yogaFloatFromFabricFloat(Float value) {
inline float yogaFloatFromFloat(Float value) {
if (value == kFloatUndefined) {
return YGUndefined;
}
@ -34,20 +34,20 @@ inline float yogaFloatFromFabricFloat(Float value) {
return (float)value;
}
inline Float fabricFloatFromYogaOptionalFloat(YGFloatOptional value) {
inline Float floatFromYogaOptionalFloat(YGFloatOptional value) {
if (value.isUndefined()) {
return kFloatUndefined;
}
return fabricFloatFromYogaFloat(value.getValue());
return floatFromYogaFloat(value.getValue());
}
inline YGFloatOptional yogaOptionalFloatFromFabricFloat(Float value) {
inline YGFloatOptional yogaOptionalFloatFromFloat(Float value) {
if (value == kFloatUndefined) {
return YGFloatOptional();
}
return YGFloatOptional(yogaFloatFromFabricFloat(value));
return YGFloatOptional(yogaFloatFromFloat(value));
}
inline YGValue yogaStyleValueFromFloat(const Float &value) {
@ -63,9 +63,9 @@ inline folly::Optional<Float> optionalFloatFromYogaValue(const YGValue &value, f
case YGUnitUndefined:
return {};
case YGUnitPoint:
return fabricFloatFromYogaFloat(value.value);
return floatFromYogaFloat(value.value);
case YGUnitPercent:
return base.has_value() ? folly::Optional<Float>(base.value() * fabricFloatFromYogaFloat(value.value)) : folly::Optional<Float>();
return base.has_value() ? folly::Optional<Float>(base.value() * floatFromYogaFloat(value.value)) : folly::Optional<Float>();
case YGUnitAuto:
return {};
}
@ -78,27 +78,27 @@ inline LayoutMetrics layoutMetricsFromYogaNode(YGNode &yogaNode) {
layoutMetrics.frame = Rect {
Point {
fabricFloatFromYogaFloat(layout.position[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.position[YGEdgeTop])
floatFromYogaFloat(layout.position[YGEdgeLeft]),
floatFromYogaFloat(layout.position[YGEdgeTop])
},
Size {
fabricFloatFromYogaFloat(layout.dimensions[YGDimensionWidth]),
fabricFloatFromYogaFloat(layout.dimensions[YGDimensionHeight])
floatFromYogaFloat(layout.dimensions[YGDimensionWidth]),
floatFromYogaFloat(layout.dimensions[YGDimensionHeight])
}
};
layoutMetrics.borderWidth = EdgeInsets {
fabricFloatFromYogaFloat(layout.border[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.border[YGEdgeTop]),
fabricFloatFromYogaFloat(layout.border[YGEdgeRight]),
fabricFloatFromYogaFloat(layout.border[YGEdgeBottom])
floatFromYogaFloat(layout.border[YGEdgeLeft]),
floatFromYogaFloat(layout.border[YGEdgeTop]),
floatFromYogaFloat(layout.border[YGEdgeRight]),
floatFromYogaFloat(layout.border[YGEdgeBottom])
};
layoutMetrics.contentInsets = EdgeInsets {
fabricFloatFromYogaFloat(layout.border[YGEdgeLeft] + layout.padding[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.border[YGEdgeTop] + layout.padding[YGEdgeTop]),
fabricFloatFromYogaFloat(layout.border[YGEdgeRight] + layout.padding[YGEdgeRight]),
fabricFloatFromYogaFloat(layout.border[YGEdgeBottom] + layout.padding[YGEdgeBottom])
floatFromYogaFloat(layout.border[YGEdgeLeft] + layout.padding[YGEdgeLeft]),
floatFromYogaFloat(layout.border[YGEdgeTop] + layout.padding[YGEdgeTop]),
floatFromYogaFloat(layout.border[YGEdgeRight] + layout.padding[YGEdgeRight]),
floatFromYogaFloat(layout.border[YGEdgeBottom] + layout.padding[YGEdgeBottom])
};
layoutMetrics.displayType =
@ -393,7 +393,7 @@ inline std::string toString(const YGFloatOptional &value) {
return "undefined";
}
return folly::to<std::string>(fabricFloatFromYogaFloat(value.getValue()));
return folly::to<std::string>(floatFromYogaFloat(value.getValue()));
}
inline std::string toString(const std::array<YGValue, YGDimensionCount> &value) {

View File

@ -168,11 +168,11 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector(YGNode *yogaNo
case YGMeasureModeUndefined:
break;
case YGMeasureModeExactly:
minimumSize.width = fabricFloatFromYogaFloat(width);
maximumSize.width = fabricFloatFromYogaFloat(width);
minimumSize.width = floatFromYogaFloat(width);
maximumSize.width = floatFromYogaFloat(width);
break;
case YGMeasureModeAtMost:
maximumSize.width = fabricFloatFromYogaFloat(width);
maximumSize.width = floatFromYogaFloat(width);
break;
}
@ -180,19 +180,19 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector(YGNode *yogaNo
case YGMeasureModeUndefined:
break;
case YGMeasureModeExactly:
minimumSize.height = fabricFloatFromYogaFloat(height);
maximumSize.height = fabricFloatFromYogaFloat(height);
minimumSize.height = floatFromYogaFloat(height);
maximumSize.height = floatFromYogaFloat(height);
break;
case YGMeasureModeAtMost:
maximumSize.height = fabricFloatFromYogaFloat(height);
maximumSize.height = floatFromYogaFloat(height);
break;
}
auto size = shadowNodeRawPtr->measure({minimumSize, maximumSize});
return YGSize {
yogaFloatFromFabricFloat(size.width),
yogaFloatFromFabricFloat(size.height)
yogaFloatFromFloat(size.width),
yogaFloatFromFloat(size.height)
};
}