Skip to content

Commit

Permalink
Fix justify content with min/max constraint parent
Browse files Browse the repository at this point in the history
Summary:
The min/max inner width shouldn't take the margins into account.
Adds a test for both cases.

Fixes #664
Closes facebook/yoga#665

Differential Revision: D6407982

Pulled By: emilsjolander

fbshipit-source-id: ffa549a06f802263e3b8488e90756aa3f722d52d
  • Loading branch information
woehrl01 authored and facebook-github-bot committed Nov 24, 2017
1 parent 05e862d commit f5beceb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1862,17 +1862,17 @@ static void YGNodelayoutImpl(const YGNodeRef node,

// STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS
const float minInnerWidth =
YGResolveValue(&node->style.minDimensions[YGDimensionWidth], parentWidth) - marginAxisRow -
YGResolveValue(&node->style.minDimensions[YGDimensionWidth], parentWidth) -
paddingAndBorderAxisRow;
const float maxInnerWidth =
YGResolveValue(&node->style.maxDimensions[YGDimensionWidth], parentWidth) - marginAxisRow -
YGResolveValue(&node->style.maxDimensions[YGDimensionWidth], parentWidth) -
paddingAndBorderAxisRow;
const float minInnerHeight =
YGResolveValue(&node->style.minDimensions[YGDimensionHeight], parentHeight) -
marginAxisColumn - paddingAndBorderAxisColumn;
paddingAndBorderAxisColumn;
const float maxInnerHeight =
YGResolveValue(&node->style.maxDimensions[YGDimensionHeight], parentHeight) -
marginAxisColumn - paddingAndBorderAxisColumn;
paddingAndBorderAxisColumn;
const float minInnerMainDim = isMainAxisRow ? minInnerWidth : minInnerHeight;
const float maxInnerMainDim = isMainAxisRow ? maxInnerWidth : maxInnerHeight;

Expand Down

0 comments on commit f5beceb

Please sign in to comment.