Make sure to autoscroll to a selected entity after a rename (#872)

This commit is contained in:
Terry Michaels
2021-05-21 14:56:59 -05:00
committed by GitHub
parent 44ec0211a0
commit d785b3310f
2 changed files with 22 additions and 0 deletions
@@ -65,6 +65,7 @@
#include "OutlinerTreeView.hxx"
#include "Include/ICommandManager.h"
#include "Include/IObjectManager.h"
#include "OutlinerCacheBus.h"
#include <Editor/CryEditDoc.h>
#include <AzCore/Outcome/Outcome.h>
@@ -1538,6 +1539,16 @@ void OutlinerListModel::OnEntityInfoUpdatedName(AZ::EntityId entityId, const AZS
{
(void)name;
QueueEntityUpdate(entityId);
bool isSelected = false;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId);
if (isSelected)
{
// Ask the system to scroll to the entity in case it is off screen after the rename
OutlinerModelNotificationBus::Broadcast(&OutlinerModelNotifications::QueueScrollToNewContent, entityId);
}
}
void OutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId)