Function taffy::compute::grid::implicit_grid::compute_grid_size_estimate

source ยท
pub(crate) fn compute_grid_size_estimate<'a, S: GridItemStyle + 'a>(
    explicit_col_count: u16,
    explicit_row_count: u16,
    child_styles_iter: impl Iterator<Item = S>,
) -> (TrackCounts, TrackCounts)
Expand description

Estimate the number of rows and columns in the grid This is used as a performance optimisation to pre-size vectors and reduce allocations. It also forms a necessary step in the auto-placement

  • The estimates for the explicit and negative implicit track counts are exact.
  • However, the estimates for the positive explicit track count is a lower bound as auto-placement can affect this in ways which are impossible to predict until the auto-placement algorithm is run.

Note that this function internally mixes use of grid track numbers and grid line numbers