From 2e3e4959d63f3aa8800d5a45513003a4fea9177f Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 10 May 2024 17:18:10 -0500 Subject: [PATCH] Add width padding for tooltip --- Source/Engine/UI/GUI/Tooltip.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Tooltip.cs b/Source/Engine/UI/GUI/Tooltip.cs index ef07bfa79..a7f80e152 100644 --- a/Source/Engine/UI/GUI/Tooltip.cs +++ b/Source/Engine/UI/GUI/Tooltip.cs @@ -234,11 +234,16 @@ namespace FlaxEngine.GUI Render2D.FillRectangle(new Rectangle(Float2.Zero, Size), Color.Lerp(style.BackgroundSelected, style.Background, 0.6f)); Render2D.FillRectangle(new Rectangle(1.1f, 1.1f, Width - 2, Height - 2), style.Background); + // Padding for text + var textRect = GetClientArea(); + textRect.X += 5; + textRect.Width -= 10; + // Tooltip text Render2D.DrawText( style.FontMedium, _currentText, - GetClientArea(), + textRect, style.Foreground, TextAlignment.Center, TextAlignment.Center,