mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Merge pull request #207 from Tom94/fix-back-button-hover
Fix being able to hover the back button from outside of its shape.
This commit is contained in:
commit
e49f312f3f
@ -19,6 +19,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private Container leftContainer;
|
||||
private Container rightContainer;
|
||||
|
||||
private Box leftBox;
|
||||
private Box rightBox;
|
||||
|
||||
private const double transform_time = 300.0;
|
||||
private const int pulse_length = 250;
|
||||
|
||||
@ -39,7 +42,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Width = 0.4f,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
leftBox = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = new Color4(195, 40, 140, 255),
|
||||
@ -61,7 +64,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Width = 0.6f,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
rightBox = new Box
|
||||
{
|
||||
Colour = new Color4(238, 51, 153, 255),
|
||||
Origin = Anchor.TopLeft,
|
||||
@ -80,6 +83,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public override bool Contains(Vector2 screenSpacePos)
|
||||
{
|
||||
return leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
icon.ClearTransformations();
|
||||
|
Loading…
Reference in New Issue
Block a user