1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 23:07:26 +08:00

Simplify line move logic in ToolbarRulesetSelector (#5433)

Simplify line move logic in ToolbarRulesetSelector
This commit is contained in:
Dean Herbert 2019-07-23 11:41:20 +09:00 committed by GitHub
commit cf1ec5692a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
});