mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
8b0ccd2bdb
commit
d98a229202
@@ -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 <>
|
||||
|
||||
Reference in New Issue
Block a user