Skip to main content

Module flex

Module flex 

Source
Expand description

§Flex Layout Utilities

Helper functions for the flexbox algorithm. The main flex logic lives in the layout engine’s layout_flex_row method. This module provides the lower-level distribution calculations.

Structs§

WrapLine
A single line of items in a wrapping flex row.

Functions§

distribute_grow
Distribute remaining space among items based on flex-grow factors.
distribute_shrink
Shrink items to fit within available space based on flex-shrink factors.
partition_into_lines
Partition items into wrap lines based on available width. Always adds at least one item per line (prevents infinite loops on oversized items).