mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Instantiate selection box on SetUp
This commit is contained in:
@ -17,32 +17,30 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
private Container selectionArea;
|
private Container selectionArea;
|
||||||
private SelectionBox selectionBox;
|
private SelectionBox selectionBox;
|
||||||
|
|
||||||
public TestSceneComposeSelectBox()
|
[SetUp]
|
||||||
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
AddStep("create box", () =>
|
Child = selectionArea = new Container
|
||||||
Child = selectionArea = new Container
|
{
|
||||||
|
Size = new Vector2(400),
|
||||||
|
Position = -new Vector2(150),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Size = new Vector2(400),
|
selectionBox = new SelectionBox
|
||||||
Position = -new Vector2(150),
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
selectionBox = new SelectionBox
|
CanRotate = true,
|
||||||
{
|
CanScaleX = true,
|
||||||
CanRotate = true,
|
CanScaleY = true,
|
||||||
CanScaleX = true,
|
|
||||||
CanScaleY = true,
|
|
||||||
|
|
||||||
OnRotation = handleRotation,
|
OnRotation = handleRotation,
|
||||||
OnScale = handleScale
|
OnScale = handleScale
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
};
|
||||||
|
|
||||||
AddToggleStep("toggle rotation", state => selectionBox.CanRotate = state);
|
InputManager.MoveMouseTo(selectionBox);
|
||||||
AddToggleStep("toggle x", state => selectionBox.CanScaleX = state);
|
});
|
||||||
AddToggleStep("toggle y", state => selectionBox.CanScaleY = state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool handleScale(Vector2 amount, Anchor reference)
|
private bool handleScale(Vector2 amount, Anchor reference)
|
||||||
{
|
{
|
||||||
@ -72,15 +70,6 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[SetUp]
|
|
||||||
public void SetUp() => Schedule(() =>
|
|
||||||
{
|
|
||||||
InputManager.MoveMouseTo(selectionBox);
|
|
||||||
selectionBox.CanRotate = true;
|
|
||||||
selectionBox.CanScaleX = true;
|
|
||||||
selectionBox.CanScaleY = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRotationHandleShownOnHover()
|
public void TestRotationHandleShownOnHover()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user