Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yoga: call getMeasure even when YGMeasureModeExactly #100

Merged
merged 3 commits into from
Jul 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,16 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
: YGFloatMax(
0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn);

// Measure the text under the current constraints.
const YGSize measuredSize = marker::MarkerSection<YGMarkerMeasure>::wrap(
node,
node->getMeasure(),
node,
innerWidth,
widthMeasureMode,
innerHeight,
heightMeasureMode);

if (widthMeasureMode == YGMeasureModeExactly &&
heightMeasureMode == YGMeasureModeExactly) {
// Don't bother sizing the text if both dimensions are already defined.
Expand All @@ -1689,16 +1699,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
ownerWidth),
YGDimensionHeight);
} else {
// Measure the text under the current constraints.
const YGSize measuredSize = marker::MarkerSection<YGMarkerMeasure>::wrap(
node,
node->getMeasure(),
node,
innerWidth,
widthMeasureMode,
innerHeight,
heightMeasureMode);

node->setLayoutMeasuredDimension(
YGNodeBoundAxis(
node,
Expand Down