1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:52:55 +08:00

simplify moving condition

This commit is contained in:
Andrei Zavatski 2019-07-22 23:22:39 +03:00
parent 3fde4efaee
commit ffcc1c62af

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