1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 15:40:31 +08:00

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.
This commit is contained in:
Bartłomiej Dach
2025-09-30 12:57:10 +02:00
Unverified
parent a078d4bdb4
commit 2edd49d2c0
+2 -2
View File
@@ -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