Skip to content

Commit f8ea23d

Browse files
committed
Fix editor "Collapse all" button collapsing empty groups
Empty groups cannot normally be collapsed/expanded by double-clicking, but the "Collapse all" button caused empty groups to be collapsed anyway, which could not be expanded anymore by double-clicking.
1 parent c6677bc commit f8ea23d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/game/editor/editor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,10 +3676,10 @@ void CEditor::RenderLayers(CUIRect LayersBox)
36763676
LayersBox.HSplitTop(RowHeight + 1.0f, &CollapseAllButton, &LayersBox);
36773677
if(s_ScrollRegion.AddRect(CollapseAllButton))
36783678
{
3679-
unsigned long TotalCollapsed = 0;
3679+
size_t TotalCollapsed = 0;
36803680
for(const auto &pGroup : Map()->m_vpGroups)
36813681
{
3682-
if(pGroup->m_Collapse)
3682+
if(pGroup->m_vpLayers.empty() || pGroup->m_Collapse)
36833683
{
36843684
TotalCollapsed++;
36853685
}
@@ -3695,7 +3695,7 @@ void CEditor::RenderLayers(CUIRect LayersBox)
36953695
{
36963696
if(TotalCollapsed == Map()->m_vpGroups.size())
36973697
pGroup->m_Collapse = false;
3698-
else
3698+
else if(!pGroup->m_vpLayers.empty())
36993699
pGroup->m_Collapse = true;
37003700
}
37013701
}

0 commit comments

Comments
 (0)