mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added some missing logic to flexbox
This commit is contained in:
parent
e1abac681d
commit
b56e7560a7
1 changed files with 10 additions and 2 deletions
|
|
@ -386,6 +386,8 @@ struct FlexBoxLayoutCalculation
|
|||
|
||||
if (isRowDirection)
|
||||
item.setHeightChecked (lineSize - item.item->margin.top - item.item->margin.bottom);
|
||||
else
|
||||
item.setWidthChecked (lineSize - item.item->margin.left - item.item->margin.right);
|
||||
}
|
||||
else if (owner.alignItems == FlexBox::AlignItems::flexStart)
|
||||
{
|
||||
|
|
@ -393,11 +395,17 @@ struct FlexBoxLayoutCalculation
|
|||
}
|
||||
else if (owner.alignItems == FlexBox::AlignItems::flexEnd)
|
||||
{
|
||||
item.lockedMarginTop = lineSize - item.lockedHeight - item.item->margin.bottom;
|
||||
if (isRowDirection)
|
||||
item.lockedMarginTop = lineSize - item.lockedHeight - item.item->margin.bottom;
|
||||
else
|
||||
item.lockedMarginLeft = lineSize - item.lockedWidth - item.item->margin.right;
|
||||
}
|
||||
else if (owner.alignItems == FlexBox::AlignItems::center)
|
||||
{
|
||||
item.lockedMarginTop = (lineSize - item.lockedHeight - item.item->margin.top - item.item->margin.bottom) / 2;
|
||||
if (isRowDirection)
|
||||
item.lockedMarginTop = (lineSize - item.lockedHeight - item.item->margin.top - item.item->margin.bottom) / 2;
|
||||
else
|
||||
item.lockedMarginLeft = (lineSize - item.lockedWidth - item.item->margin.left - item.item->margin.right) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue