From b27ccc5f3be689e29e100fbbb35daea340a7be25 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 17 Oct 2024 18:42:39 +0200 Subject: [PATCH] condense switch statement --- Source/Engine/UI/GUI/Tooltip.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Source/Engine/UI/GUI/Tooltip.cs b/Source/Engine/UI/GUI/Tooltip.cs index bac74b5ab..dbd91ffef 100644 --- a/Source/Engine/UI/GUI/Tooltip.cs +++ b/Source/Engine/UI/GUI/Tooltip.cs @@ -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;