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

Rename arrow direction method

This commit is contained in:
Andrei Zavatski 2020-07-14 03:01:14 +03:00
parent f6e4ecd960
commit 56349e65f3
3 changed files with 6 additions and 6 deletions

View File

@ -41,11 +41,11 @@ namespace osu.Game.Tests.Visual.UserInterface
}
[Test]
public void TestArrowRotation()
public void TestArrowDirection()
{
AddStep("Toggle icon up", () => button.ToggleIcon(true));
AddStep("Set upwards", () => button.SetIconDirection(true));
AddAssert("Icon facing upwards", () => button.Icon.Scale.Y == -1);
AddStep("Toggle icon down", () => button.ToggleIcon(false));
AddStep("Set downwards", () => button.SetIconDirection(false));
AddAssert("Icon facing downwards", () => button.Icon.Scale.Y == 1);
}
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Text = "sample text";
}
public new void ToggleIcon(bool upwards) => base.ToggleIcon(upwards);
public new void SetIconDirection(bool upwards) => base.SetIconDirection(upwards);
}
}
}

View File

@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Comments.Buttons
icon.Colour = colourProvider.Foreground1;
}
protected void ToggleIcon(bool upwards) => icon.ScaleTo(new Vector2(1, upwards ? -1 : 1));
protected void SetIconDirection(bool upwards) => icon.ScaleTo(new Vector2(1, upwards ? -1 : 1));
protected override bool OnHover(HoverEvent e)
{

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Comments.Buttons
protected override void LoadComplete()
{
base.LoadComplete();
Expanded.BindValueChanged(expanded => ToggleIcon(expanded.NewValue), true);
Expanded.BindValueChanged(expanded => SetIconDirection(expanded.NewValue), true);
}
protected override bool OnClick(ClickEvent e)