From 2edd49d2c041b2ba6fd759dd1f18dff501500263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 30 Sep 2025 12:57:10 +0200 Subject: [PATCH] Add half-height-of-selected-panel adjustment to carousel scroll target Intended to address https://github.com/ppy/osu/issues/35147, maybe? The old carousel would target the vertical center of the active panel when scrolling: https://github.com/ppy/osu/blob/b9e1b6969e78dfa798bb4afed8afae55e9e4adb1/osu.Game/Screens/Select/BeatmapCarousel.cs#L948 This was not in place in the new carousel, weirdly, which was targeting the top-left corner of the selected panel. --- osu.Game/Graphics/Carousel/Carousel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Carousel/Carousel.cs b/osu.Game/Graphics/Carousel/Carousel.cs index 0df183bb71..8f001007b9 100644 --- a/osu.Game/Graphics/Carousel/Carousel.cs +++ b/osu.Game/Graphics/Carousel/Carousel.cs @@ -761,10 +761,10 @@ namespace osu.Game.Graphics.Carousel updateItemYPosition(item, ref lastVisible, ref yPos); if (CheckModelEquality(item.Model, currentKeyboardSelection.Model!)) - currentKeyboardSelection = new Selection(currentKeyboardSelection.Model, item, item.CarouselYPosition, i); + currentKeyboardSelection = new Selection(currentKeyboardSelection.Model, item, item.CarouselYPosition + item.DrawHeight / 2, i); if (CheckModelEquality(item.Model, currentSelection.Model!)) - currentSelection = new Selection(currentSelection.Model, item, item.CarouselYPosition, i); + currentSelection = new Selection(currentSelection.Model, item, item.CarouselYPosition + item.DrawHeight / 2, i); } // Update the total height of all items (to make the scroll container scrollable through the full height even though