condense switch statement

This commit is contained in:
xxSeys1
2024-10-17 18:42:39 +02:00
parent 7558cce609
commit b27ccc5f3b

View File

@@ -239,19 +239,12 @@ namespace FlaxEngine.GUI
// Padding for text
var textRect = GetClientArea();
float textX = 0;
switch (Editor.Instance.Options.Options.Interface.TooltipTextAlignment)
float textX = Editor.Instance.Options.Options.Interface.TooltipTextAlignment switch
{
case TextAlignment.Near:
textX = 15;
break;
case TextAlignment.Center:
textX = 5;
break;
case TextAlignment.Far:
textX = -5;
break;
}
TextAlignment.Near => 15,
TextAlignment.Center => 5,
TextAlignment.Far => -5,
};
textRect.X += textX;
textRect.Width -= 10;