1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a flex box bug where the first item in a list of too large items would not be layouted properly

This commit is contained in:
hogliux 2016-10-27 18:36:47 +01:00
parent ae13dd6d6c
commit 15bed81f87

View file

@ -132,6 +132,7 @@ struct FlexBoxLayoutCalculation
{
auto currentLength = containerLineLength;
int column = 0, row = 0;
bool firstRow = true;
for (auto& item : itemStates)
{
@ -141,7 +142,10 @@ struct FlexBoxLayoutCalculation
if (flexitemLength > currentLength)
{
if (++row >= numItems)
if (! firstRow)
row++;
if (row >= numItems)
break;
column = 0;
@ -153,6 +157,7 @@ struct FlexBoxLayoutCalculation
lineItems[row * numItems + column] = &item;
++column;
lineInfo[row].numItems = jmax (lineInfo[row].numItems, column);
firstRow = false;
}
}
}