Revert D9286928: [yoga] Solve width bug when the size is less than min
Differential Revision: D9286928 Original commit changeset: 915269602cda fbshipit-source-id: a4c23bf335b82fbbf3928a524a61374a6cf6ffb1
This commit is contained in:
parent
af49568482
commit
f0631b11f5
|
@ -2396,13 +2396,20 @@ static void YGJustifyMainAxis(
|
||||||
const bool& performLayout) {
|
const bool& performLayout) {
|
||||||
const YGStyle& style = node->getStyle();
|
const YGStyle& style = node->getStyle();
|
||||||
|
|
||||||
// If we are using "at most" rules in the main axis, make sure that
|
// If we are using "at most" rules in the main axis. Calculate the remaining
|
||||||
// remainingFreeSpace is 0 when min main dimension is not given
|
// space when constraint by the min size defined for the main axis.
|
||||||
if (measureModeMainDim == YGMeasureModeAtMost &&
|
if (measureModeMainDim == YGMeasureModeAtMost &&
|
||||||
collectedFlexItemsValues.remainingFreeSpace > 0) {
|
collectedFlexItemsValues.remainingFreeSpace > 0) {
|
||||||
if (style.minDimensions[dim[mainAxis]].unit == YGUnitUndefined ||
|
if (style.minDimensions[dim[mainAxis]].unit != YGUnitUndefined &&
|
||||||
YGResolveValue(style.minDimensions[dim[mainAxis]], mainAxisownerSize)
|
!YGResolveValue(style.minDimensions[dim[mainAxis]], mainAxisownerSize)
|
||||||
.isUndefined()) {
|
.isUndefined()) {
|
||||||
|
collectedFlexItemsValues.remainingFreeSpace = YGFloatMax(
|
||||||
|
0,
|
||||||
|
YGUnwrapFloatOptional(YGResolveValue(
|
||||||
|
style.minDimensions[dim[mainAxis]], mainAxisownerSize)) -
|
||||||
|
(availableInnerMainDim -
|
||||||
|
collectedFlexItemsValues.remainingFreeSpace));
|
||||||
|
} else {
|
||||||
collectedFlexItemsValues.remainingFreeSpace = 0;
|
collectedFlexItemsValues.remainingFreeSpace = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue