Skip to content

Commit

Permalink
Merge branch 'Tryibion-tooltip-text-padding'
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiesto4 committed May 15, 2024
2 parents fa23619 + 57084b3 commit 63cc0fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Engine/UI/GUI/Tooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,16 @@ public override void Draw()
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,
Expand Down

0 comments on commit 63cc0fe

Please sign in to comment.