1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 01:49:53 +08:00

Add fadein to SelectionBox

This commit is contained in:
smoogipoo
2018-02-15 19:07:53 +09:00
Unverified
parent dcbc8c3dcd
commit 4ac0c48ba6
2 changed files with 7 additions and 2 deletions
@@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
/// <summary>
/// A box that represents a drag selection.
/// </summary>
public class SelectionBox : CompositeDrawable
public class SelectionBox : VisibilityContainer
{
/// <summary>
/// Creates a new <see cref="SelectionBox"/>.
@@ -52,6 +52,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
Size = bottomRight - topLeft;
}
public override void Hide() => this.FadeOut(250, Easing.OutQuint).Expire();
protected override void PopIn() => this.FadeIn(250, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(250, Easing.OutQuint);
}
}
@@ -43,6 +43,8 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
protected override bool OnDrag(InputState state)
{
selectionBox.Show();
var dragPosition = state.Mouse.NativeState.Position;
var dragStartPosition = state.Mouse.NativeState.PositionMouseDown ?? dragPosition;
@@ -57,6 +59,8 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
protected override bool OnDragEnd(InputState state)
{
selectionBox.Hide();
selectionBox.Expire();
finishSelection();
return true;