Expand description
Contains TrackCounts used to keep track of the number of tracks in the explicit and implicit grids. Also contains coordinate conversion functions which depend on those counts
Taffy uses two coordinate systems to refer to grid lines (the gaps/gutters between rows/columns):
“CSS Grid Line” coordinates are those used in grid-row/grid-column in the CSS grid spec: - 0 is not a valid index - The line at left hand (or top) edge of the explicit grid is line 1 (and counts up from there) - The line at the right hand (or bottom) edge of the explicit grid in -1 (and counts down from there)
“OriginZero” coordinates are a normalized form: - The line at left hand (or top) edge of the explicit grid is line 0 - The next line to the right (or down) is 1, and so on - The next line to the left (or up) is -1, and so on
Taffy also uses two coordinate systems to refer to grid tracks (rows/columns):
Both of these systems represent the entire implicit grid, not just the explicit grid.
“CellOccupancyMatrix track indices”: - These are indexes into the CellOccupancyMatrix - The CellOccupancyMatrix stores only tracks - 0 is the leftmost track of the implicit grid, and indexes count up there
“GridTrackVec track indices”: - The GridTrackVecs store both lines and tracks, so: - even indices (0, 2, 4, etc) represent lines - odd indices (1, 3, 5, etc) represent tracks - These is always an odd number of - Index 1 is the leftmost track of the implicit grid. Index 3 is the second leftmost track, etc. - Index 0 is the leftmost grid line. Index 2 is the second leftmost line, etc.
Structs§
- Stores the number of tracks in a given dimension. Stores separately the number of tracks in the implicit and explicit grids