1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 05:42:56 +08:00

Add overlapping spacing support

This commit is contained in:
Dean Herbert 2025-01-15 19:02:27 +09:00
parent a1c5fad6d4
commit 54f9cb7f68
No known key found for this signature in database

View File

@ -51,6 +51,11 @@ namespace osu.Game.Screens.SelectV2
/// </summary>
public float DistanceOffscreenToPreload { get; set; }
/// <summary>
/// Vertical space between panel layout. Negative value can be used to create an overlapping effect.
/// </summary>
protected float SpacingBetweenPanels { get; set; } = -5;
/// <summary>
/// When a new request arrives to change filtering, the number of milliseconds to wait before performing the filter.
/// Regardless of any external debouncing, this is a safety measure to avoid triggering too many threaded operations.
@ -207,13 +212,12 @@ namespace osu.Game.Screens.SelectV2
private async Task updateYPositions(IEnumerable<CarouselItem> carouselItems, CancellationToken cancellationToken) => await Task.Run(() =>
{
const float spacing = 10;
float yPos = 0;
foreach (var item in carouselItems)
{
item.CarouselYPosition = yPos;
yPos += item.DrawHeight + spacing;
yPos += item.DrawHeight + SpacingBetweenPanels;
}
}, cancellationToken).ConfigureAwait(false);