From cf8c1c67fe60df116d4560bda417f9ee7bc190df Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 14 Jun 2016 21:00:57 -0400 Subject: [PATCH] Clarified the previous commit. --- darwin/grid.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwin/grid.m b/darwin/grid.m index aaf7a142..9f91e1cb 100644 --- a/darwin/grid.m +++ b/darwin/grid.m @@ -148,6 +148,7 @@ struct uiGrid { int firstx, firsty; BOOL *hexpand, *vexpand; BOOL doit; + BOOL onlyEmptyAndSpanning; [self removeOurConstraints]; if ([self->children count] == 0) @@ -158,6 +159,7 @@ struct uiGrid { // ignore hidden controls first = YES; for (gc in self->children) { + // this bit is important: it ensures row ymin and column xmin have at least one cell to draw, so the onlyEmptyAndSpanning logic below will never run on those rows if (!uiControlVisible(gc.c)) continue; if (first) { @@ -206,7 +208,6 @@ struct uiGrid { } // if a row or column only contains emptys and spanning cells of a opposite-direction spannings, remove it by duplicating the previous row or column - BOOL onlyEmptyAndSpanning; for (y = 0; y < ycount; y++) { onlyEmptyAndSpanning = YES; for (x = 0; x < xcount; x++)