resolveMainAxis
Function resolveMainAxis
resolveMainAxis(children: Node[], axis: MainAxis, availableMain: number, availableCross: number, gap: number): MainAxisLayoutResolve a stack's main-axis layout, applying flex-shrink when intrinsic
sizes exceed the available main-axis dimension and at least one child has
shrink > 0. Returns possibly-cloned children with reduced widths/heights
and their final measured sizes (cross-axis dimensions reflect any text
rewrapping that resulted from the shrink).
availableMain is the inner main-axis space (already net of padding).
Pass Infinity when the parent has no main-axis constraint — shrink will
not fire in that case.
availableCross is what measure(child, ...) should receive as
parentWidth for vertical stacks. For an hstack, the main axis IS the
width, so the parentWidth passed to children IS availableMain.
Parameters
-
children: Node[] -
axis: MainAxis -
availableMain: number -
availableCross: number -
gap: number
Returns MainAxisLayout