diff --git a/java/com/facebook/yoga/YogaEventListener.java b/java/com/facebook/yoga/YogaEventListener.java index 97791224..cc7e9ebd 100644 --- a/java/com/facebook/yoga/YogaEventListener.java +++ b/java/com/facebook/yoga/YogaEventListener.java @@ -12,4 +12,6 @@ public interface YogaEventListener { void onNodeMeasure(YogaNode node); + void onNodeLayout(YogaNode node, boolean performLayout); + } diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index c46104be..6c739a06 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -3670,7 +3670,7 @@ bool YGLayoutNodeInternal( YGMarkerLayoutData& layoutMarkerData, void* const layoutContext) { #ifdef YG_ENABLE_EVENTS - Event::publish(node); + Event::publish(node, {performLayout, layoutContext}); #endif YGLayout* layout = &node->getLayout(); diff --git a/yoga/event/event.h b/yoga/event/event.h index bff8dbfd..9dcd73b6 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -82,5 +82,11 @@ struct Event::TypedData { void* layoutContext; }; +template <> +struct Event::TypedData { + bool performLayout; + void* layoutContext; +}; + } // namespace yoga } // namespace facebook