Revert "Merge pull request #21614 from EVAST9919/button-fix"

This reverts commit 4bd196684f, reversing
changes made to a1d22ef77a.
This commit is contained in:
Dean Herbert 2022-12-12 13:43:01 +09:00
parent 4bd196684f
commit 731184eb39
2 changed files with 0 additions and 45 deletions

View File

@ -1,41 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Overlays.Settings;
using NUnit.Framework;
using osuTK;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual.UserInterface
{
public partial class TestSceneSettingsButton : OsuManualInputManagerTestScene
{
private readonly SettingsButton settingsButton;
public TestSceneSettingsButton()
{
Add(new Container
{
AutoSizeAxes = Axes.Y,
Width = 500,
Child = settingsButton = new SettingsButton
{
Enabled = { Value = true },
Text = "Test settings button"
}
});
}
[Test]
public void TestInputAtPaddedArea()
{
AddStep("Move cursor to button", () => InputManager.MoveMouseTo(settingsButton));
AddAssert("Button is hovered", () => settingsButton.IsHovered);
AddStep("Move cursor to padded area", () => InputManager.MoveMouseTo(settingsButton.ScreenSpaceDrawQuad.TopLeft + new Vector2(SettingsPanel.CONTENT_MARGINS / 2f, 10)));
AddAssert("Cursor within a button", () => settingsButton.ScreenSpaceDrawQuad.Contains(InputManager.CurrentState.Mouse.Position));
AddAssert("Button is not hovered", () => !settingsButton.IsHovered);
}
}
}

View File

@ -9,15 +9,11 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osuTK;
namespace osu.Game.Overlays.Settings
{
public partial class SettingsButton : RoundedButton, IHasTooltip, IConditionalFilterable
{
// We don't want to receive input at the padded area
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Content.ReceivePositionalInputAt(screenSpacePos);
public SettingsButton()
{
RelativeSizeAxes = Axes.X;