Skip to content

Commit

Permalink
Let measure behave more like on the web
Browse files Browse the repository at this point in the history
Summary:
Nodes with a measure function needs to be measured even so it seems there is no available space. So it behaves more like on the web. Fix facebook/yoga#488
Closes facebook/yoga#499

Differential Revision: D4850458

Pulled By: emilsjolander

fbshipit-source-id: be5e35a670ddcbf3cd426fc3c2a0c9b60a874cdc
  • Loading branch information
woehrl01 authored and Maxime Aoustin committed Apr 19, 2017
1 parent 6cb1979 commit b87de4d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -1654,13 +1654,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(const YGNodeRef node,
node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth);
node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(
node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth);
} else if (innerWidth <= 0.0f || innerHeight <= 0.0f) {
// Don't bother sizing the text if there's no horizontal or vertical
// space.
node->layout.measuredDimensions[YGDimensionWidth] =
YGNodeBoundAxis(node, YGFlexDirectionRow, 0.0f, availableWidth, availableWidth);
node->layout.measuredDimensions[YGDimensionHeight] =
YGNodeBoundAxis(node, YGFlexDirectionColumn, 0.0f, availableHeight, availableWidth);
} else {
// Measure the text under the current constraints.
const YGSize measuredSize =
Expand Down

0 comments on commit b87de4d

Please sign in to comment.