Permalink
Browse files

Fix justify content + min dimension when children overflow

Reviewed By: gkassabli

Differential Revision: D4029442

fbshipit-source-id: d28ebd269c452c3359e16ecc5749a415da6e4d75
  • Loading branch information...
1 parent 72cd12e commit 3e332d9cc8444d8d13b162505931d35d8888bf5f @emilsjolander emilsjolander committed with Facebook Github Bot Oct 17, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 React/CSSLayout/CSSLayout.c
@@ -1544,9 +1544,10 @@ static void layoutNodeImpl(const CSSNodeRef node,
// 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) {
+
+ 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));
+ remainingFreeSpace = fmax(0, node->style.minDimensions[dim[mainAxis]] - (availableInnerMainDim - remainingFreeSpace));
} else {
remainingFreeSpace = 0;
}

0 comments on commit 3e332d9

Please sign in to comment.