From 2107b069dbf71f4a656ceba75583d2cb055eccab Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 4 May 2024 19:25:56 -0500 Subject: [PATCH 1/2] Fix odd offset between 1st property and property label. --- Source/Editor/CustomEditors/GUI/PropertiesList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/GUI/PropertiesList.cs b/Source/Editor/CustomEditors/GUI/PropertiesList.cs index 28e1c9a4f..eb02c73d4 100644 --- a/Source/Editor/CustomEditors/GUI/PropertiesList.cs +++ b/Source/Editor/CustomEditors/GUI/PropertiesList.cs @@ -242,7 +242,7 @@ namespace FlaxEditor.CustomEditors.GUI float namesWidth = _splitterValue * Width; int count = _element.Labels.Count; float[] yStarts = new float[count + 1]; - for (int i = 1; i < count; i++) + for (int i = 0; i < count; i++) { var label = _element.Labels[i]; @@ -258,7 +258,7 @@ namespace FlaxEditor.CustomEditors.GUI { var label = _element.Labels[i]; - var rect = new Rectangle(0, yStarts[i] + 1, namesWidth, yStarts[i + 1] - yStarts[i] - 2); + var rect = new Rectangle(0, yStarts[i], namesWidth, yStarts[i + 1] - yStarts[i] - 2); //label.Parent = this; label.Bounds = rect; } From bf4e4aeaf615813cf322da206fa50fe2f2e9ce83 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 4 May 2024 22:32:00 -0500 Subject: [PATCH 2/2] Fix bottom offset for last property label and property --- Source/Editor/CustomEditors/GUI/PropertiesList.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/GUI/PropertiesList.cs b/Source/Editor/CustomEditors/GUI/PropertiesList.cs index eb02c73d4..208dc64e6 100644 --- a/Source/Editor/CustomEditors/GUI/PropertiesList.cs +++ b/Source/Editor/CustomEditors/GUI/PropertiesList.cs @@ -251,14 +251,18 @@ namespace FlaxEditor.CustomEditors.GUI else if (_children.Count <= label.FirstChildControlIndex) yStarts[i] = y; else + { yStarts[i] = _children[label.FirstChildControlIndex].Top; + if (i == count - 1) + yStarts[i + 1] = _children[label.FirstChildControlIndex].Bottom; + } + } - yStarts[count] = y; for (int i = 0; i < count; i++) { var label = _element.Labels[i]; - var rect = new Rectangle(0, yStarts[i], namesWidth, yStarts[i + 1] - yStarts[i] - 2); + var rect = new Rectangle(0, yStarts[i] + 1, namesWidth, yStarts[i + 1] - yStarts[i] - 2); //label.Parent = this; label.Bounds = rect; }