Fix editor log spam by rebuilding layout when Custom Editor throws exception on update

#2935
This commit is contained in:
Wojtek Figat
2024-09-23 13:58:56 +02:00
parent 371e16a857
commit e22f4a28bd

View File

@@ -93,6 +93,9 @@ namespace FlaxEditor.CustomEditors
catch (Exception ex)
{
FlaxEditor.Editor.LogWarning(ex);
// Refresh layout on errors to reduce lgo spam
_presenter.BuildLayout();
}
base.Update(deltaTime);
@@ -397,6 +400,7 @@ namespace FlaxEditor.CustomEditors
Panel.DisposeChildren();
ClearLayout();
_buildOnUpdate = false;
Editor.Setup(this);
Panel.IsLayoutLocked = false;
@@ -484,7 +488,6 @@ namespace FlaxEditor.CustomEditors
{
if (_buildOnUpdate)
{
_buildOnUpdate = false;
BuildLayout();
}