Sizing modes
sizeMode tells the projection engine which axes of an item keep their pixel size when the layout is re-fit to another canvas.
fixedWidth and fixedHeight hold the pinned pixel size. When they are absent, w and h are used. syncFixedDimensions(items) copies the pinned size into w/h and the matching min/max so a layout that was edited by hand is consistent before projection.
Under projection
With the chain strategy, a fixed axis keeps its pixels and the rest of the chain absorbs the change. A fixed item that touches a canvas edge stays anchored to that edge after projection. With the segment strategy, a segment covered only by fixed items is treated as fixed and never scales.
Under solving
The size mode also influences the solvers, because "keep this axis fixed" is a statement about intent:
- Pushing. A fixed-axis item that sits flush against the canvas edge opposite the push direction is treated as anchored, and the push is refused (
isEdgeAnchoredAgainstPush). The solver moves on to the next strategy instead of squeezing it. - Resizing.
resizeRectandclampItemhonormaxW/maxHonly on axes that are fixed; free axes are bounded by the canvas. Minimums apply on every axis. - Compaction.
compactLayouttreats fixed-height items as rigid: they keep their height while flexible items shrink towardminH. Add more rigid items throughCompactOptions.isRigid.
isFixedWidth, isFixedHeight, and isFixedOnAxis(item, axis) are the predicates the engine uses; they are exported for your own layout logic.