Skip to content

Commit

Permalink
Fix justify content + min dimension usage in root
Browse files Browse the repository at this point in the history
Reviewed By: gkassabli, lucasr

Differential Revision: D4021443

fbshipit-source-id: 00f58c6078ac3076221e1148aacc34712786deb5
  • Loading branch information
Emil Sjolander authored and Facebook Github Bot committed Oct 17, 2016
1 parent c84157a commit d376155
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions React/CSSLayout/CSSLayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1514,10 +1514,14 @@ static void layoutNodeImpl(const CSSNodeRef node,
// that are aligned "stretch". We need to compute these stretch values and
// set the final positions.

// If we are using "at most" rules in the main axis, we won't distribute
// any remaining space at this point.
// If we are using "at most" rules in the main axis. Calculate the remaining space when
// constraint by the min size defined for the main axis.
if (measureModeMainDim == CSSMeasureModeAtMost) {
remainingFreeSpace = 0;
if (!CSSValueIsUndefined(node->style.minDimensions[dim[mainAxis]]) && node->style.minDimensions[dim[mainAxis]] >= 0) {
remainingFreeSpace = fmaxf(0, node->style.minDimensions[dim[mainAxis]] - (availableInnerMainDim - remainingFreeSpace));
} else {
remainingFreeSpace = 0;
}
}

switch (justifyContent) {
Expand Down

0 comments on commit d376155

Please sign in to comment.