Fix text clipping behind the button in Behavior Knowledge Selector editor

This commit is contained in:
Wojtek Figat
2025-02-21 19:34:35 +01:00
parent bd9a5f03a4
commit b81b0b7616
2 changed files with 7 additions and 3 deletions

View File

@@ -257,10 +257,12 @@ namespace FlaxEngine.GUI
{
base.DrawSelf();
if (ClipText)
Render2D.PushClip(new Rectangle(Float2.Zero, Size));
var margin = _margin;
var rect = new Rectangle(margin.Location, Size - margin.Size);
if (ClipText)
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;