From a130ac2f9c7a7440c036a803d27795c106c5c4e5 Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Wed, 12 Jun 2019 00:26:21 -0700 Subject: [PATCH] pass measure callback data from c++ to java Summary: Passing Measure callback data - width, widthMeasureMode, height, heightMeasureMode, measuredWidth and measuredHeight along with NodeMeasure event This data is then propagated to java layer in this diff Reviewed By: davidaurelio Differential Revision: D15697523 fbshipit-source-id: 615463da237175ff88abef3f6528b55333ccd915 --- yoga/Yoga.cpp | 10 +++++++++- yoga/event/event.h | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index e8a2e512..1fa81110 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1636,7 +1636,15 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( layoutContext); #ifdef YG_ENABLE_EVENTS - Event::publish(node, {layoutContext}); + Event::publish( + node, + {layoutContext, + innerWidth, + widthMeasureMode, + innerHeight, + heightMeasureMode, + measuredSize.width, + measuredSize.height}); #endif node->setLayoutMeasuredDimension( diff --git a/yoga/event/event.h b/yoga/event/event.h index e7415566..5a955ea9 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -8,6 +8,7 @@ #include #include +#include "../YGEnums.h" struct YGConfig; struct YGNode; @@ -85,6 +86,12 @@ struct Event::TypedData { template <> struct Event::TypedData { void* layoutContext; + float width; + YGMeasureMode widthMeasureMode; + float height; + YGMeasureMode heightMeasureMode; + float measuredWidth; + float measuredHeight; }; template <>