diff --git a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs index aa2735e87..0a78240f2 100644 --- a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs @@ -497,8 +497,9 @@ namespace FlaxEditor.CustomEditors.Dedicated private void BuildExtraButtons(VerticalPanelElement group) { - // Set to default for UI editing - (Values[0] as Control).PivotRelative = true; + (Values[0] as Control).PivotRelative = Editor.Instance.Windows.PropertiesWin.PivotRelativeSize; + + var current = Editor.Instance.Windows.PropertiesWin.PivotRelativeSize; var panel = group.CustomContainer(); panel.CustomControl.Height = TextBoxBase.DefaultHeight; @@ -515,7 +516,7 @@ namespace FlaxEditor.CustomEditors.Dedicated X = 77, }; - SetStyle(true); + SetStyle(current); _pivotRelativeButton.Clicked += PivotRelativeClicked; } @@ -523,6 +524,7 @@ namespace FlaxEditor.CustomEditors.Dedicated { var current = (Values[0] as Control).PivotRelative; (Values[0] as Control).PivotRelative = !current; + Editor.Instance.Windows.PropertiesWin.PivotRelativeSize = !current; SetStyle((Values[0] as Control).PivotRelative); } diff --git a/Source/Editor/Windows/PropertiesWindow.cs b/Source/Editor/Windows/PropertiesWindow.cs index 601717f38..69fac31d7 100644 --- a/Source/Editor/Windows/PropertiesWindow.cs +++ b/Source/Editor/Windows/PropertiesWindow.cs @@ -30,6 +30,11 @@ namespace FlaxEditor.Windows /// public bool ScaleLinked = false; + /// + /// Indictation of if UI elements should size relative to the pivot point + /// + public bool PivotRelativeSize = true; + /// /// Initializes a new instance of the class. ///