mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 06:38:13 +00:00
Marker for baseline callbacks
Summary: @public Wraps baseline callbacks with a marker. Reviewed By: SidharthGuglani Differential Revision: D13896861 fbshipit-source-id: 848ec697977a0a68b9943f1159f6562d54724f89
This commit is contained in:
parent
d2b2316722
commit
e2bd70afff
@ -16,6 +16,7 @@ typedef struct YGConfig* YGConfigRef;
|
|||||||
typedef YG_ENUM_BEGIN(YGMarker){
|
typedef YG_ENUM_BEGIN(YGMarker){
|
||||||
YGMarkerLayout,
|
YGMarkerLayout,
|
||||||
YGMarkerMeasure,
|
YGMarkerMeasure,
|
||||||
|
YGMarkerBaselineFn,
|
||||||
} YG_ENUM_END(YGMarker);
|
} YG_ENUM_END(YGMarker);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -66,14 +67,19 @@ struct MarkerData<YGMarkerLayout> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
struct NoMarkerData {
|
||||||
struct MarkerData<YGMarkerMeasure> {
|
|
||||||
using type = YGMarkerNoData;
|
using type = YGMarkerNoData;
|
||||||
static type*& get(YGMarkerData& d) {
|
static type*& get(YGMarkerData& d) {
|
||||||
return d.noData;
|
return d.noData;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct MarkerData<YGMarkerMeasure> : NoMarkerData {};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct MarkerData<YGMarkerBaselineFn> : NoMarkerData {};
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
template <YGMarker M>
|
template <YGMarker M>
|
||||||
|
@ -1074,7 +1074,9 @@ static inline YGAlign YGNodeAlignItem(
|
|||||||
|
|
||||||
static float YGBaseline(const YGNodeRef node) {
|
static float YGBaseline(const YGNodeRef node) {
|
||||||
if (node->getBaseline() != nullptr) {
|
if (node->getBaseline() != nullptr) {
|
||||||
const float baseline = node->getBaseline()(
|
const float baseline = marker::MarkerSection<YGMarkerBaselineFn>::wrap(
|
||||||
|
node,
|
||||||
|
node->getBaseline(),
|
||||||
node,
|
node,
|
||||||
node->getLayout().measuredDimensions[YGDimensionWidth],
|
node->getLayout().measuredDimensions[YGDimensionWidth],
|
||||||
node->getLayout().measuredDimensions[YGDimensionHeight]);
|
node->getLayout().measuredDimensions[YGDimensionHeight]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user