mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
fix layout crash if some node is too large to fit in any row
This commit is contained in:
parent
8fd027531b
commit
187e360201
1 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,9 @@ AxisLayout::Row* AxisLayout::fitInRow(CCNode* on, CCArray* nodes, float scale, f
|
|||
nextAxisLength += pos.axisLength;
|
||||
// if multiple rows are allowed and this row is full, time for the
|
||||
// next row
|
||||
if (m_growCrossAxis && nextAxisLength > available.axisLength) {
|
||||
// also force at least one object to be added to this row, because if
|
||||
// it's too large for this row it's gonna be too large for all rows
|
||||
if (m_growCrossAxis && nextAxisLength > available.axisLength && ix != 0) {
|
||||
break;
|
||||
}
|
||||
res->addObject(node);
|
||||
|
|
Loading…
Reference in a new issue