           rMax = max r, rMax
           bMax = max b, bMax
 
+      sizeWithPadding (rMax - lMin), (bMax - tMin), currentPadding
+
     else
       for child in children
-
-        r = child.getPendingMaxXInParentSpace()
-        b = child.getPendingMaxYInParentSpace()
-
-        if first
-          first = false
-          rMax = r
-          bMax = b
-        else
-          rMax = max r, rMax
-          bMax = max b, bMax
-
-    sizeWithPadding (rMax - lMin), (bMax - tMin), currentPadding
+        rMax = max rMax, child.getPendingMaxXInParentSpace()
+        bMax = max bMax, child.getPendingMaxYInParentSpace()
+
+      sizeWithPadding rMax, bMax, currentPadding
 
   # NOTE: grid layout determines an area dedicated to each element.
   #   This area is passed to the element as-if it was the parent's full children-area

          child.getPendingCurrentSize().x

      offset += gridSize

  defaultWidthOfEachLine = (i, widthOfEachLine) -> widthOfEachLine[i]
  alignChildren = (state, parentSize, childrenSize) ->

  ) ->
    return point0 unless children?.length > 0

    bMax = rMax = 0

    if customComputeChildArea = element.getPendingChildArea()
      tMin = lMin = 0
      l = r = t = b = 0
      first = true

      for child in children

        area = customComputeChildArea child, reusableRectForChildrenSizeCalc
