From 8d3af91048c943f7f99dc6502884bb0a3e22a33f Mon Sep 17 00:00:00 2001 From: VladV Date: Sun, 15 Oct 2023 12:14:53 +0400 Subject: [PATCH] Fix incorrect prefab modification gui --- Editor/Editors/TriEditorCore.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Editor/Editors/TriEditorCore.cs b/Editor/Editors/TriEditorCore.cs index bebff09..dc7334d 100644 --- a/Editor/Editors/TriEditorCore.cs +++ b/Editor/Editors/TriEditorCore.cs @@ -113,12 +113,32 @@ namespace TriInspector.Editors EditorGUIUtility.labelWidth = Mathf.Max(labelMinWidth, container.resolvedStyle.width * labelWidthRatio - space); + GUILayout.BeginVertical(Styles.RootLayout); OnInspectorGUI(root); - })); + GUILayout.EndVertical(); + }) + { + style = + { + marginLeft = -Styles.RootMarginLeft, + marginRight = -Styles.RootMarginRight, + }, + }); container.Add(root); return container; } + + private static class Styles + { + public const int RootMarginLeft = 15; + public const int RootMarginRight = 6; + + public static readonly GUIStyle RootLayout = new GUIStyle + { + padding = new RectOffset(RootMarginLeft, RootMarginRight, 0, 0), + }; + } } } \ No newline at end of file