1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Merge pull request #20960 from Joehuu/fix-logo-drag-area

Fix osu! logo drag area being a square
This commit is contained in:
Dean Herbert 2022-10-27 11:18:23 +09:00 committed by GitHub
commit 2a5465129e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,7 +113,7 @@ namespace osu.Game.Screens.Menu
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
logoBounceContainer = new DragContainer logoBounceContainer = new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
@ -407,8 +407,6 @@ namespace osu.Game.Screens.Menu
impactContainer.ScaleTo(1.12f, 250); impactContainer.ScaleTo(1.12f, 250);
} }
private class DragContainer : Container
{
public override bool DragBlocksClick => false; public override bool DragBlocksClick => false;
protected override bool OnDragStart(DragStartEvent e) => true; protected override bool OnDragStart(DragStartEvent e) => true;
@ -420,14 +418,13 @@ namespace osu.Game.Screens.Menu
// Diminish the drag distance as we go further to simulate "rubber band" feeling. // Diminish the drag distance as we go further to simulate "rubber band" feeling.
change *= change.Length <= 0 ? 0 : MathF.Pow(change.Length, 0.6f) / change.Length; change *= change.Length <= 0 ? 0 : MathF.Pow(change.Length, 0.6f) / change.Length;
this.MoveTo(change); logoBounceContainer.MoveTo(change);
} }
protected override void OnDragEnd(DragEndEvent e) protected override void OnDragEnd(DragEndEvent e)
{ {
this.MoveTo(Vector2.Zero, 800, Easing.OutElastic); logoBounceContainer.MoveTo(Vector2.Zero, 800, Easing.OutElastic);
base.OnDragEnd(e); base.OnDragEnd(e);
} }
} }
}
} }