From 38adb8ecd20a38734452399b7065b68c796dd494 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 --- ReactCommon/yoga/yoga/Yoga.cpp | 10 +++++++++- ReactCommon/yoga/yoga/event/event.h | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index e8a2e51234..1fa81110fd 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/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/ReactCommon/yoga/yoga/event/event.h b/ReactCommon/yoga/yoga/event/event.h index e7415566f5..5a955ea931 100644 --- a/ReactCommon/yoga/yoga/event/event.h +++ b/ReactCommon/yoga/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 <>