From e22f4a28bd6770d23bf49b6ebb54d4c824395835 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 23 Sep 2024 13:58:56 +0200 Subject: [PATCH] Fix editor log spam by rebuilding layout when Custom Editor throws exception on update #2935 --- Source/Editor/CustomEditors/CustomEditorPresenter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Editor/CustomEditors/CustomEditorPresenter.cs b/Source/Editor/CustomEditors/CustomEditorPresenter.cs index 3ab550b84..703c3f51b 100644 --- a/Source/Editor/CustomEditors/CustomEditorPresenter.cs +++ b/Source/Editor/CustomEditors/CustomEditorPresenter.cs @@ -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(); }