diff --git a/tests/EventsTest.cpp b/tests/EventsTest.cpp index b940c6b1..c34dd547 100644 --- a/tests/EventsTest.cpp +++ b/tests/EventsTest.cpp @@ -134,10 +134,9 @@ void EventTest::listen(const YGNode& node, Event::Type type, Event::Data data) { events.push_back(createArgs(node, data)); break; case Event::LayoutPassStart: - break; case Event::LayoutPassEnd: - break; - case Event::NodeMeasure: + case Event::MeasureCallbackStart: + case Event::MeasureCallbackEnd: break; } } diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 7b470f5d..0888710f 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1642,6 +1642,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( } else { #ifdef YG_ENABLE_EVENTS auto start = steady_clock::now(); + Event::publish(node); #endif // Measure the text under the current constraints. @@ -1661,7 +1662,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( auto measureCallbackDuration = duration_cast>(end - start); - Event::publish( + Event::publish( node, {layoutContext, innerWidth, diff --git a/yoga/event/event.h b/yoga/event/event.h index 4179e9be..eb32b457 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -31,7 +31,8 @@ struct Event { NodeLayout, LayoutPassStart, LayoutPassEnd, - NodeMeasure, + MeasureCallbackStart, + MeasureCallbackEnd, }; class Data; using Subscriber = void(const YGNode&, Type, Data); @@ -93,7 +94,7 @@ struct Event::TypedData { }; template <> -struct Event::TypedData { +struct Event::TypedData { void* layoutContext; float width; YGMeasureMode widthMeasureMode;