diff --git a/Source/Engine/UI/GUI/Panels/PanelWithMargins.cs b/Source/Engine/UI/GUI/Panels/PanelWithMargins.cs index 52222946e..067fa72e5 100644 --- a/Source/Engine/UI/GUI/Panels/PanelWithMargins.cs +++ b/Source/Engine/UI/GUI/Panels/PanelWithMargins.cs @@ -35,6 +35,8 @@ namespace FlaxEngine.GUI /// protected TextAlignment _alignment = TextAlignment.Near; + private bool _controlChildSize = true; + /// /// Gets or sets the left margin. /// @@ -158,7 +160,18 @@ namespace FlaxEngine.GUI /// Gets or sets the value indicating whenever the panel can resize children controls (eg. auto-fit width/height). /// [EditorOrder(35), DefaultValue(true), Tooltip("If checked, the panel can resize children controls (eg. auto-fit width/height).")] - public bool ControlChildSize { get; set; } = true; + public bool ControlChildSize + { + get => _controlChildSize; + set + { + if (_controlChildSize != value) + { + _controlChildSize = value; + PerformLayout(); + } + } + } /// /// Gets or sets the panel area margin.