Expand description
Pure layout math for the justified-row masonry grid.
pack_rows greedily fills rows up to canvas_w then scales each row to
fit. Includes O(log n) row lookup helpers used by the snapshot + hit-test
paths.
Structsยง
Constantsยง
- FALLBACK_
H ๐ - FALLBACK_
W ๐ - GAP ๐
- MAX_
ROW_ ๐HEIGHT_ COMPACT - MAX_
ROW_ ๐HEIGHT_ NARROW - MAX_
ROW_ ๐HEIGHT_ WIDE - MIN_
ROW_ ๐HEIGHT_ COMPACT - MIN_
ROW_ ๐HEIGHT_ NARROW - MIN_
ROW_ ๐HEIGHT_ WIDE
Functionsยง
- aspect ๐
- build_
row ๐ - Scale, clamp, and place items into a single laid-out row.
- collect_
row_ ๐indices - Greedily collect item indices that fit into a single row at max height.
- first_
row_ ๐at_ or_ after - item_
at_ ๐x - pack_
rows ๐ - Greedy justified-row pack.
dims[i] = (w, h)for asset i. - row_
at_ ๐y - scale_
to_ ๐fit