Merge pull request #17410 from groud/fix_grid_container
Fixes infinite loop in GridContainer
This commit is contained in:
commit
b1c9a7c757
1 changed files with 4 additions and 4 deletions
|
@ -88,10 +88,10 @@ void GridContainer::_notification(int p_what) {
|
||||||
remaining_space.width -= hsep * (max_col - 1);
|
remaining_space.width -= hsep * (max_col - 1);
|
||||||
|
|
||||||
bool can_fit = false;
|
bool can_fit = false;
|
||||||
while (!can_fit) {
|
while (!can_fit && col_expanded.size() > 0) {
|
||||||
// Check if all minwidth constraints are ok if we use the remaining space
|
// Check if all minwidth constraints are ok if we use the remaining space
|
||||||
can_fit = true;
|
can_fit = true;
|
||||||
int max_index = 0;
|
int max_index = col_expanded.front()->get();
|
||||||
for (Set<int>::Element *E = col_expanded.front(); E; E = E->next()) {
|
for (Set<int>::Element *E = col_expanded.front(); E; E = E->next()) {
|
||||||
if (col_minw[E->get()] > col_minw[max_index]) {
|
if (col_minw[E->get()] > col_minw[max_index]) {
|
||||||
max_index = E->get();
|
max_index = E->get();
|
||||||
|
@ -109,10 +109,10 @@ void GridContainer::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
|
|
||||||
can_fit = false;
|
can_fit = false;
|
||||||
while (!can_fit) {
|
while (!can_fit && row_expanded.size() > 0) {
|
||||||
// Check if all minwidth constraints are ok if we use the remaining space
|
// Check if all minwidth constraints are ok if we use the remaining space
|
||||||
can_fit = true;
|
can_fit = true;
|
||||||
int max_index = 0;
|
int max_index = row_expanded.front()->get();
|
||||||
for (Set<int>::Element *E = row_expanded.front(); E; E = E->next()) {
|
for (Set<int>::Element *E = row_expanded.front(); E; E = E->next()) {
|
||||||
if (row_minh[E->get()] > row_minh[max_index]) {
|
if (row_minh[E->get()] > row_minh[max_index]) {
|
||||||
max_index = E->get();
|
max_index = E->get();
|
||||||
|
|
Loading…
Reference in a new issue