From ffcc1c62af5fcfed1d9ec7b3b322b4145d724d56 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Mon, 22 Jul 2019 23:22:39 +0300 Subject: [PATCH] simplify moving condition --- osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index bf0cd91321..927986159b 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -71,15 +71,7 @@ namespace osu.Game.Overlays.Toolbar // Scheduled to allow the flow layout to be computed before the line position is updated private void moveLineToCurrent() => ScheduleAfterChildren(() => { - foreach (var tabItem in TabContainer) - { - if (tabItem.Value.Equals(Current.Value)) - { - ModeButtonLine.MoveToX(tabItem.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint); - break; - } - } - + ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint); hasInitialPosition = true; });