1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 14:02:55 +08:00

Merge pull request #18155 from frenzibyte/results-screen-scaling

Remove dual-direction mouse wheel scrolling at results screen
This commit is contained in:
Dean Herbert 2022-05-09 17:16:29 +09:00 committed by GitHub
commit 2aa5524c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 10 deletions

View File

@ -8,11 +8,23 @@ using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Tests.Resources;
using osuTK;
namespace osu.Game.Tests.Visual.Multiplayer
{
public class TestSceneMultiplayerTeamResults : ScreenTestScene
{
[Test]
public void TestScaling()
{
// scheduling is needed as scaling the content immediately causes the entire scene to shake badly, for some odd reason.
AddSliderStep("scale", 0.5f, 1.6f, 1f, v => Schedule(() =>
{
Stack.Scale = new Vector2(v);
Stack.Size = new Vector2(1f / v);
}));
}
[TestCase(7483253, 1048576)]
[TestCase(1048576, 7483253)]
[TestCase(1048576, 1048576)]

View File

@ -56,6 +56,17 @@ namespace osu.Game.Tests.Visual.Ranking
});
}
[Test]
public void TestScaling()
{
// scheduling is needed as scaling the content immediately causes the entire scene to shake badly, for some odd reason.
AddSliderStep("scale", 0.5f, 1.6f, 1f, v => Schedule(() =>
{
Content.Scale = new Vector2(v);
Content.Size = new Vector2(1f / v);
}));
}
[Test]
public void TestResultsWithoutPlayer()
{

View File

@ -85,7 +85,6 @@ namespace osu.Game.Screens.Ranking
InternalChild = scroll = new Scroll
{
RelativeSizeAxes = Axes.Both,
HandleScroll = () => expandedPanel?.IsHovered != true, // handle horizontal scroll only when not hovering the expanded panel.
Child = flow = new Flow
{
Anchor = Anchor.Centre,
@ -359,11 +358,6 @@ namespace osu.Game.Screens.Ranking
/// </summary>
public float? InstantScrollTarget;
/// <summary>
/// Whether this container should handle scroll trigger events.
/// </summary>
public Func<bool> HandleScroll;
protected override void UpdateAfterChildren()
{
if (InstantScrollTarget != null)
@ -374,10 +368,6 @@ namespace osu.Game.Screens.Ranking
base.UpdateAfterChildren();
}
public override bool HandlePositionalInput => HandleScroll();
public override bool HandleNonPositionalInput => HandleScroll();
}
}
}