Skip to content

Commit

Permalink
Merge pull request #263 from adriengivry/fix/actor-hierarchy-leaf-bug
Browse files Browse the repository at this point in the history
Fixed an issue where deleting an actor would leave an empty expandable tree node
  • Loading branch information
litelawliet authored Nov 23, 2023
2 parents 71c9841 + 3e10067 commit 5b87501
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Overload/OvEditor/src/OvEditor/Panels/Hierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ void OvEditor::Panels::Hierarchy::DeleteActorByInstance(OvCore::ECS::Actor& p_ac
result->second->Destroy();
}

if (p_actor.HasParent() && p_actor.GetParent()->GetChildren().size() == 1)
{
if (auto parentWidget = m_widgetActorLink.find(p_actor.GetParent()); parentWidget != m_widgetActorLink.end())
{
parentWidget->second->leaf = true;
}
}

m_widgetActorLink.erase(result);
}
}
Expand Down

0 comments on commit 5b87501

Please sign in to comment.