Skip to content

Commit

Permalink
Yoga: call getMeasure even when YGMeasureModeExactly (#100)
Browse files Browse the repository at this point in the history
* Yoga: call getMeasure even when YGMeasureModeExactly

* Revert "Yoga: call getMeasure even when YGMeasureModeExactly"

This reverts commit fccb3a4.

* Yoga: call getMeasure even when YGMeasureModeExactly
  • Loading branch information
sagokhal authored and acoates-ms committed Jul 2, 2019
1 parent b087e2f commit 3432672
Showing 1 changed file with 10 additions and 10 deletions.
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

0 comments on commit 3432672

Please sign in to comment.