mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +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>
|
/// <summary>
|
||||||
/// A box that represents a drag selection.
|
/// A box that represents a drag selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SelectionBox : CompositeDrawable
|
public class SelectionBox : VisibilityContainer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="SelectionBox"/>.
|
/// Creates a new <see cref="SelectionBox"/>.
|
||||||
@ -52,6 +52,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
Size = bottomRight - topLeft;
|
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)
|
protected override bool OnDrag(InputState state)
|
||||||
{
|
{
|
||||||
|
selectionBox.Show();
|
||||||
|
|
||||||
var dragPosition = state.Mouse.NativeState.Position;
|
var dragPosition = state.Mouse.NativeState.Position;
|
||||||
var dragStartPosition = state.Mouse.NativeState.PositionMouseDown ?? dragPosition;
|
var dragStartPosition = state.Mouse.NativeState.PositionMouseDown ?? dragPosition;
|
||||||
|
|
||||||
@ -57,6 +59,8 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|||||||
protected override bool OnDragEnd(InputState state)
|
protected override bool OnDragEnd(InputState state)
|
||||||
{
|
{
|
||||||
selectionBox.Hide();
|
selectionBox.Hide();
|
||||||
|
selectionBox.Expire();
|
||||||
|
|
||||||
finishSelection();
|
finishSelection();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user