From cb42ef95c57cf6f86c66dd882962b1532401d823 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 6 Feb 2025 17:48:42 +0900 Subject: [PATCH] Add invalidation on draw size change in beatmap carousel v2 Matching old implementation. --- osu.Game/Screens/SelectV2/Carousel.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Screens/SelectV2/Carousel.cs b/osu.Game/Screens/SelectV2/Carousel.cs index 1fd2f0a9b0..4248641a43 100644 --- a/osu.Game/Screens/SelectV2/Carousel.cs +++ b/osu.Game/Screens/SelectV2/Carousel.cs @@ -16,6 +16,7 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Pooling; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; +using osu.Framework.Layout; using osu.Framework.Logging; using osu.Framework.Utils; using osu.Game.Graphics.Containers; @@ -678,6 +679,15 @@ namespace osu.Game.Screens.SelectV2 carouselPanel.Expanded.Value = false; } + protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source) + { + // handles the vertical size of the carousel changing (ie. on window resize when aspect ratio has changed). + if (invalidation.HasFlag(Invalidation.DrawSize)) + selectionValid.Invalidate(); + + return base.OnInvalidate(invalidation, source); + } + #endregion #region Internal helper classes