diff --git a/Source/Editor/CustomEditors/Editors/BehaviorKnowledgeSelectorEditor.cs b/Source/Editor/CustomEditors/Editors/BehaviorKnowledgeSelectorEditor.cs index b172694f2..0d7b4a9af 100644 --- a/Source/Editor/CustomEditors/Editors/BehaviorKnowledgeSelectorEditor.cs +++ b/Source/Editor/CustomEditors/Editors/BehaviorKnowledgeSelectorEditor.cs @@ -26,6 +26,8 @@ namespace FlaxEditor.CustomEditors.Editors public override void Initialize(LayoutElementsContainer layout) { _label = layout.ClickableLabel(Path).CustomControl; + _label.Margin = new Margin(0, 20.0f, 0, 0); + _label.ClipText = true; _label.RightClick += ShowPicker; var button = new Button { diff --git a/Source/Engine/UI/GUI/Common/Label.cs b/Source/Engine/UI/GUI/Common/Label.cs index 773200d49..dca68948c 100644 --- a/Source/Engine/UI/GUI/Common/Label.cs +++ b/Source/Engine/UI/GUI/Common/Label.cs @@ -257,10 +257,12 @@ namespace FlaxEngine.GUI { base.DrawSelf(); + var margin = _margin; + var rect = new Rectangle(margin.Location, Size - margin.Size); + if (ClipText) - Render2D.PushClip(new Rectangle(Float2.Zero, Size)); + Render2D.PushClip(ref rect); - var rect = new Rectangle(new Float2(Margin.Left, Margin.Top), Size - Margin.Size); var color = IsMouseOver || IsNavFocused ? TextColorHighlighted : TextColor; if (!EnabledInHierarchy) color *= 0.6f;