Skip to content

fontlabapp.qt.layouts.stack · declarations 001

Back to fontlabapp.qt.layouts.stack

Distribution module-attribute

Distribution

distribute

distribute(sizes: list[float], length: float, spacing: float, mode: Distribution) -> list[float]

Update sizes in place and return axis offsets, in input order.

Supply finite sizes, length and spacing. Equal/proportional modes clamp resized sizes at zero; proportional all-zero sizes stay zero. Spacing is a minimum, so overcrowded fixed/spacing stacks can overflow. Centering keeps endpoint centers and can overlap. Negative spacing remains allowed. Fixed mode leaves sizes unchanged. Empty input returns no offsets. Foreign enum mapping belongs to the caller. Unknown modes raise before any mutation. See Glyport's NSStackView and Vanilla VerticalStackView.