Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// 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.

#nullable disable
Expand Down Expand Up @@ -277,13 +277,18 @@ public void TestShowStatisticsAndClickOtherPanel()
ScorePanel expandedPanel = null;
ScorePanel contractedPanel = null;

AddUntilStep("wait for panels", () =>
{
expandedPanel = this.ChildrenOfType<ScorePanel>().SingleOrDefault(p => p.State == PanelState.Expanded);
contractedPanel = this.ChildrenOfType<ScorePanel>().FirstOrDefault(p => p.State == PanelState.Contracted && p.ScreenSpaceDrawQuad.TopLeft.X > screen.ScreenSpaceDrawQuad.TopLeft.X);
return expandedPanel != null && contractedPanel != null;
});

AddStep("click expanded panel then contracted panel", () =>
{
expandedPanel = this.ChildrenOfType<ScorePanel>().Single(p => p.State == PanelState.Expanded);
InputManager.MoveMouseTo(expandedPanel);
InputManager.Click(MouseButton.Left);

contractedPanel = this.ChildrenOfType<ScorePanel>().First(p => p.State == PanelState.Contracted && p.ScreenSpaceDrawQuad.TopLeft.X > screen.ScreenSpaceDrawQuad.TopLeft.X);
InputManager.MoveMouseTo(contractedPanel);
InputManager.Click(MouseButton.Left);
});
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Graphics/UserInterface/OsuDropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using osu.Game.Input.Bindings;
using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osu.Framework.Utils;
using osuTK;
using osuTK.Graphics;

Expand Down Expand Up @@ -109,8 +110,7 @@ protected override void AnimateClose()
// todo: this uses the same styling as OsuMenu. hopefully we can just use OsuMenu in the future with some refactoring
protected override void UpdateSize(Vector2 newSize)
{
// TODO: should probably fix this at a framework level (this method is running every frame which can spam transforms)
if (newSize == targetSize)
if (targetSize.HasValue && Precision.AlmostEquals(newSize, targetSize.Value))
return;

targetSize = newSize;
Expand Down