Fix text clipping behind the button in Behavior Knowledge Selector editor

This commit is contained in:
2025-02-21 19:34:35 +01:00
parent bd9a5f03a4
commit b81b0b7616
2 changed files with 6 additions and 2 deletions
@@ -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
{
+4 -2
View File
@@ -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;