mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:57:36 +08:00
Add fadein to SelectionBox
This commit is contained in:
parent
dcbc8c3dcd
commit
4ac0c48ba6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user