summaryrefslogtreecommitdiffstats
path: root/src/tk
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-04 21:24:02 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-04 21:24:02 (EDT)
commitab9ef1a6e10552ba24e34c6ff17759213aae9aff (patch)
tree30ccdd609ef7288f89c76990dda40e8750eb8bb8 /src/tk
parent600aad24960d47077fc6351103bea75bc1b41e82 (diff)
downloadmazefight-ab9ef1a6e10552ba24e34c6ff17759213aae9aff.zip
mazefight-ab9ef1a6e10552ba24e34c6ff17759213aae9aff.tar.gz
mazefight-ab9ef1a6e10552ba24e34c6ff17759213aae9aff.tar.bz2
tk: Fix grid spacing
Diffstat (limited to 'src/tk')
-rw-r--r--src/tk/grid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tk/grid.c b/src/tk/grid.c
index de6d430..ca6b180 100644
--- a/src/tk/grid.c
+++ b/src/tk/grid.c
@@ -46,7 +46,6 @@ _mftk_grid_layout(struct mftk_widget *w)
w->h = 0;
for (r = 0; r < g->rows; ++r) {
- g->children_y[r] = w->h;
max_sz = 0;
for (c = 0; c < g->cols; ++c) {
mftk_widget_layout(g->children[r * g->cols + c]);
@@ -58,12 +57,12 @@ _mftk_grid_layout(struct mftk_widget *w)
if (r > 0) {
w->h += g->row_spacing;
}
+ g->children_y[r] = w->h;
w->h += max_sz;
}
w->w = 0;
for (c = 0; c < g->cols; ++c) {
- g->children_x[c] = w->w;
max_sz = 0;
for (r = 0; r < g->rows; ++r) {
sz = g->children[r * g->cols + c]->w;
@@ -74,6 +73,7 @@ _mftk_grid_layout(struct mftk_widget *w)
if (c > 0) {
w->w += g->col_spacing;
}
+ g->children_x[c] = w->w;
w->w += max_sz;
}
}