Pass layoutContext to Yoga's MeasureCallback

Summary:
In order to build dynamic text sizing, we need to pass layoutContext to `yogaNodeMeasureCallbackConnector`

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D20184597

fbshipit-source-id: 9df7da4bef8cbad3bc87d63ed0c5aa5f420dbc11
This commit is contained in:
Samuel Susla
2020-03-03 04:14:04 -08:00
committed by Facebook Github Bot
parent 8b0ccd2bdb
commit d98a229202
2 changed files with 9 additions and 4 deletions
@@ -245,8 +245,11 @@ void YogaLayoutableShadowNode::layoutTree(
{
SystraceSection s("YogaLayoutableShadowNode::YGNodeCalculateLayout");
YGNodeCalculateLayout(
&yogaNode_, availableWidth, availableHeight, YGDirectionInherit);
YGNodeCalculateLayoutWithContext(&yogaNode_,
availableWidth,
availableHeight,
YGDirectionInherit,
&layoutContext);
}
layout(layoutContext);
@@ -320,7 +323,8 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector(
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
YGMeasureMode heightMode,
void *layoutContext) {
SystraceSection s(
"YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector");
@@ -121,7 +121,8 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode {
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode);
YGMeasureMode heightMode,
void *layoutContext);
};
template <>