Clarified the previous commit.

This commit is contained in:
Pietro Gagliardi 2016-06-14 21:00:57 -04:00
parent cdbe48cc83
commit cf8c1c67fe
1 changed files with 2 additions and 1 deletions

View File

@ -148,6 +148,7 @@ struct uiGrid {
int firstx, firsty; int firstx, firsty;
BOOL *hexpand, *vexpand; BOOL *hexpand, *vexpand;
BOOL doit; BOOL doit;
BOOL onlyEmptyAndSpanning;
[self removeOurConstraints]; [self removeOurConstraints];
if ([self->children count] == 0) if ([self->children count] == 0)
@ -158,6 +159,7 @@ struct uiGrid {
// ignore hidden controls // ignore hidden controls
first = YES; first = YES;
for (gc in self->children) { 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)) if (!uiControlVisible(gc.c))
continue; continue;
if (first) { 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 // 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++) { for (y = 0; y < ycount; y++) {
onlyEmptyAndSpanning = YES; onlyEmptyAndSpanning = YES;
for (x = 0; x < xcount; x++) for (x = 0; x < xcount; x++)