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:
parent
ae13dd6d6c
commit
15bed81f87
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue