Add width padding for tooltip
This commit is contained in:
@@ -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(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);
|
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
|
// Tooltip text
|
||||||
Render2D.DrawText(
|
Render2D.DrawText(
|
||||||
style.FontMedium,
|
style.FontMedium,
|
||||||
_currentText,
|
_currentText,
|
||||||
GetClientArea(),
|
textRect,
|
||||||
style.Foreground,
|
style.Foreground,
|
||||||
TextAlignment.Center,
|
TextAlignment.Center,
|
||||||
TextAlignment.Center,
|
TextAlignment.Center,
|
||||||
|
|||||||
Reference in New Issue
Block a user