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
This commit is contained in:
committed by
Facebook Github Bot
parent
19fd066507
commit
a130ac2f9c
@@ -1636,7 +1636,15 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
|
|||||||
layoutContext);
|
layoutContext);
|
||||||
|
|
||||||
#ifdef YG_ENABLE_EVENTS
|
#ifdef YG_ENABLE_EVENTS
|
||||||
Event::publish<Event::NodeMeasure>(node, {layoutContext});
|
Event::publish<Event::NodeMeasure>(
|
||||||
|
node,
|
||||||
|
{layoutContext,
|
||||||
|
innerWidth,
|
||||||
|
widthMeasureMode,
|
||||||
|
innerHeight,
|
||||||
|
heightMeasureMode,
|
||||||
|
measuredSize.width,
|
||||||
|
measuredSize.height});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
node->setLayoutMeasuredDimension(
|
node->setLayoutMeasuredDimension(
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "../YGEnums.h"
|
||||||
|
|
||||||
struct YGConfig;
|
struct YGConfig;
|
||||||
struct YGNode;
|
struct YGNode;
|
||||||
@@ -85,6 +86,12 @@ struct Event::TypedData<Event::LayoutPassEnd> {
|
|||||||
template <>
|
template <>
|
||||||
struct Event::TypedData<Event::NodeMeasure> {
|
struct Event::TypedData<Event::NodeMeasure> {
|
||||||
void* layoutContext;
|
void* layoutContext;
|
||||||
|
float width;
|
||||||
|
YGMeasureMode widthMeasureMode;
|
||||||
|
float height;
|
||||||
|
YGMeasureMode heightMeasureMode;
|
||||||
|
float measuredWidth;
|
||||||
|
float measuredHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
Reference in New Issue
Block a user