Skip to content

Commit 12ca983

Browse files
add baseline start and baseline end events
Summary: Adds Baseline start and end events to be handled later for instrumentation Reviewed By: davidaurelio Differential Revision: D16048790 fbshipit-source-id: 8409dbb633168753a7bf8fab20bc6551d113ddd6
1 parent fdf3873 commit 12ca983

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,12 +997,18 @@ static inline YGAlign YGNodeAlignItem(const YGNode* node, const YGNode* child) {
997997

998998
static float YGBaseline(const YGNodeRef node, void* layoutContext) {
999999
if (node->hasBaselineFunc()) {
1000+
1001+
Event::publish<Event::NodeBaselineStart>(node);
1002+
10001003
const float baseline = marker::MarkerSection<YGMarkerBaselineFn>::wrap(
10011004
node,
10021005
&YGNode::baseline,
10031006
node->getLayout().measuredDimensions[YGDimensionWidth],
10041007
node->getLayout().measuredDimensions[YGDimensionHeight],
10051008
layoutContext);
1009+
1010+
Event::publish<Event::NodeBaselineEnd>(node);
1011+
10061012
YGAssertWithNode(
10071013
node,
10081014
!YGFloatIsUndefined(baseline),

ReactCommon/yoga/yoga/event/event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ struct Event {
3333
LayoutPassEnd,
3434
MeasureCallbackStart,
3535
MeasureCallbackEnd,
36+
NodeBaselineStart,
37+
NodeBaselineEnd,
3638
};
3739
class Data;
3840
using Subscriber = void(const YGNode&, Type, Data);

0 commit comments

Comments
 (0)