diff --git a/ReactCommon/yoga/yoga/YGMarker.h b/ReactCommon/yoga/yoga/YGMarker.h index 385ee9cf5d8..25362ff525b 100644 --- a/ReactCommon/yoga/yoga/YGMarker.h +++ b/ReactCommon/yoga/yoga/YGMarker.h @@ -16,6 +16,7 @@ typedef struct YGConfig* YGConfigRef; typedef YG_ENUM_BEGIN(YGMarker){ YGMarkerLayout, YGMarkerMeasure, + YGMarkerBaselineFn, } YG_ENUM_END(YGMarker); typedef struct { @@ -66,14 +67,19 @@ struct MarkerData { } }; -template <> -struct MarkerData { +struct NoMarkerData { using type = YGMarkerNoData; static type*& get(YGMarkerData& d) { return d.noData; } }; +template <> +struct MarkerData : NoMarkerData {}; + +template <> +struct MarkerData : NoMarkerData {}; + } // namespace detail template diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index eac63d9cde6..3f65092b69f 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1074,7 +1074,9 @@ static inline YGAlign YGNodeAlignItem( static float YGBaseline(const YGNodeRef node) { if (node->getBaseline() != nullptr) { - const float baseline = node->getBaseline()( + const float baseline = marker::MarkerSection::wrap( + node, + node->getBaseline(), node, node->getLayout().measuredDimensions[YGDimensionWidth], node->getLayout().measuredDimensions[YGDimensionHeight]);