]> git.lizzy.rs Git - nothing.git/blobdiff - src/ui/grid.c
Introduce RingBuffer
[nothing.git] / src / ui / grid.c
index 205633e99788a716124bd32e9ef227a630a54a0f..b3cbbb46bd59b64fcb242b2e06f849678285a7f6 100644 (file)
@@ -1,13 +1,13 @@
 #include "grid.h"
 
-void grid_relayout(Grid grid, Rect boundary)
+void grid_relayout(Grid *grid, Rect boundary)
 {
-    const float cell_width = boundary.w / (float) grid.columns;
-    const float cell_height = boundary.h / (float) grid.rows;
+    const float cell_width = boundary.w / (float) grid->columns;
+    const float cell_height = boundary.h / (float) grid->rows;
 
-    for (size_t row = 0; row < grid.rows; ++row) {
-        for (size_t column = 0; column < grid.columns; ++column) {
-            Widget *cell = grid.cells[row * grid.columns + column];
+    for (size_t row = 0; row < grid->rows; ++row) {
+        for (size_t column = 0; column < grid->columns; ++column) {
+            Widget *cell = grid->cells[row * grid->columns + column];
             if (cell) {
                 cell->boundary = rect(
                     boundary.x + (float) column * cell_width,