mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Instantiate selection box on SetUp
This commit is contained in:
parent
79e2b232d8
commit
7490511ebf
@ -17,9 +17,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
private Container selectionArea;
|
||||
private SelectionBox selectionBox;
|
||||
|
||||
public TestSceneComposeSelectBox()
|
||||
[SetUp]
|
||||
public void SetUp() => Schedule(() =>
|
||||
{
|
||||
AddStep("create box", () =>
|
||||
Child = selectionArea = new Container
|
||||
{
|
||||
Size = new Vector2(400),
|
||||
@ -37,12 +37,10 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
OnScale = handleScale
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
AddToggleStep("toggle rotation", state => selectionBox.CanRotate = state);
|
||||
AddToggleStep("toggle x", state => selectionBox.CanScaleX = state);
|
||||
AddToggleStep("toggle y", state => selectionBox.CanScaleY = state);
|
||||
}
|
||||
InputManager.MoveMouseTo(selectionBox);
|
||||
});
|
||||
|
||||
private bool handleScale(Vector2 amount, Anchor reference)
|
||||
{
|
||||
@ -72,15 +70,6 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
return true;
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void SetUp() => Schedule(() =>
|
||||
{
|
||||
InputManager.MoveMouseTo(selectionBox);
|
||||
selectionBox.CanRotate = true;
|
||||
selectionBox.CanScaleX = true;
|
||||
selectionBox.CanScaleY = true;
|
||||
});
|
||||
|
||||
[Test]
|
||||
public void TestRotationHandleShownOnHover()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user