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:
parent
a1c5fad6d4
commit
54f9cb7f68
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user