Class FlexboxSolver
Pure flexbox main-axis solver. Given the container's main-axis length, the gap between children, and each child's LayoutSize, it returns each child's resolved main-axis length. Absolute children (FIXED px, PERCENT of the axis) claim their size first; FLEX/AUTO children share the remaining space by weight (AUTO ≈ one flex share). When there are no flex children and the absolute sizes overflow the axis, they are scaled down proportionally to fit.
Inherited Members
Namespace: Serenity.Ui.Domain.Services
Assembly: Serenity.Ui.Domain.dll
Syntax
public static class FlexboxSolver
Remarks
Engine-free (no Unity types) so it is the single source of truth shared by the builder wireframe and the UI preview — and any other caller — instead of each re-deriving the same arithmetic.
Methods
Solve(float, float, IReadOnlyList<LayoutSize>, float)
Resolves the main-axis length of each child along a single flex axis.
Declaration
public static float[] Solve(float available, float gap, IReadOnlyList<LayoutSize> sizes, float pxScale = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| float | available | The container's main-axis length, before subtracting gaps. |
| float | gap | The gap between adjacent children. |
| IReadOnlyList<LayoutSize> | sizes | Each child's size policy, in layout order. |
| float | pxScale | Scale applied to FIXED px values: |
Returns
| Type | Description |
|---|---|
| float[] | An array of resolved main-axis lengths, one per child (empty when |