diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 8b7b1c2b..1b5a5564 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -2542,7 +2542,9 @@ static void YGJustifyMainAxis( const YGLayout childLayout = child->getLayout(); const bool isLastChild = i == collectedFlexItemsValues.endOfLineIndex - 1; // remove the gap if it is the last element of the line - betweenMainDim -= isLastChild ? gap : 0; + if (isLastChild) { + betweenMainDim -= gap; + } if (childStyle.display() == YGDisplayNone) { continue; }