Columns#
func (spec GridSpec) Columns(width float32) intColumns returns the column count for a container width. It is never below one: a container narrower than MinCellWidth gets a single, narrower column rather than overflowing.
type GridSpec struct {
MinCellWidth float32
CellHeight float32
Gap float32
}GridSpec describes a wrapping grid of equal cells. MinCellWidth is the narrowest a cell may become, not its size: the column count is the most cells of at least that width that fit, and the cells then stretch to fill the container exactly, so the grid follows its container instead of sitting at a fixed size in one corner of it.
Columns#func (spec GridSpec) Columns(width float32) intColumns returns the column count for a container width. It is never below one: a container narrower than MinCellWidth gets a single, narrower column rather than overflowing.
Height#func (spec GridSpec) Height(width float32, count int) float32Height returns the height of count cells at a container width, without a trailing gap.
Rows#func (spec GridSpec) Rows(width float32, count int) intRows returns the row count needed for count cells at a container width.