Fixed rows before columns inconsistency.

This commit is contained in:
2021-09-10 10:20:14 -07:00
parent 896b98c9aa
commit 9b179778b9
3 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,7 @@ bool sandboxSceneInit(sandboxscene_t *game) {
framedTextMenuInit(&menu, &game->font, &game->texture); framedTextMenuInit(&menu, &game->font, &game->texture);
gridAddBreakpoint(&menu.menu.menu.grid, -1, 3, 1, 0, 0); gridAddBreakpoint(&menu.menu.menu.grid, -1, 2, 3, 0, 0);
gridchild_t *child = textMenuListAdd(&menu.menu, "First"); gridchild_t *child = textMenuListAdd(&menu.menu, "First");
gridChildAddBreakpoint(child, 0,0, 1,1); gridChildAddBreakpoint(child, 0,0, 1,1);
@ -26,6 +26,8 @@ bool sandboxSceneInit(sandboxscene_t *game) {
gridChildAddBreakpoint(child, 0,1, 1,1); gridChildAddBreakpoint(child, 0,1, 1,1);
child = textMenuListAdd(&menu.menu, "Third"); child = textMenuListAdd(&menu.menu, "Third");
gridChildAddBreakpoint(child, 0,2, 1,1); gridChildAddBreakpoint(child, 0,2, 1,1);
child = textMenuListAdd(&menu.menu, "Fourth");
gridChildAddBreakpoint(child, 1,0, 1,1);
return true; return true;
} }

View File

@ -18,7 +18,7 @@ void gridInit(grid_t *grid) {
uint8_t gridAddBreakpoint( uint8_t gridAddBreakpoint(
grid_t *grid, float width, grid_t *grid, float width,
uint8_t rows, uint8_t columns, uint8_t columns, uint8_t rows,
float gutterX, float gutterY float gutterX, float gutterY
) { ) {
uint8_t i = grid->breakpointCount++; uint8_t i = grid->breakpointCount++;

View File

@ -20,15 +20,15 @@ void gridInit(grid_t *grid);
* *
* @param grid Grid to add to. * @param grid Grid to add to.
* @param width Screen dimension width of the breakpoint. * @param width Screen dimension width of the breakpoint.
* @param rows How many rows at this breakpoint.
* @param columns How many columns at this breakpoint. * @param columns How many columns at this breakpoint.
* @param rows How many rows at this breakpoint.
* @param gutterX Gutter X at this breakpoint. * @param gutterX Gutter X at this breakpoint.
* @param gutterY Gutter Y at this breakpoint. * @param gutterY Gutter Y at this breakpoint.
* @return Index of the breakpoint within the grid. * @return Index of the breakpoint within the grid.
*/ */
uint8_t gridAddBreakpoint( uint8_t gridAddBreakpoint(
grid_t *grid, float width, grid_t *grid, float width,
uint8_t rows, uint8_t columns, uint8_t columns, uint8_t rows,
float gutterX, float gutterY float gutterX, float gutterY
); );