mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 18:03:22 +08:00
Adjust xmldoc and avoid LINQ overheads
This commit is contained in:
parent
c370c75fe2
commit
9cc90a51df
@ -550,8 +550,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
updateDisplayedRange(range);
|
||||
}
|
||||
|
||||
double selectedYPos = currentSelection?.CarouselItem?.CarouselYPosition ?? 0;
|
||||
double maximumDistanceFromSelection = scroll.Panels.Select(p => Math.Abs(((ICarouselPanel)p).DrawYPosition - selectedYPos)).DefaultIfEmpty().Max();
|
||||
double selectedYPos = currentSelection.CarouselItem?.CarouselYPosition ?? 0;
|
||||
|
||||
foreach (var panel in scroll.Panels)
|
||||
{
|
||||
@ -561,8 +560,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
if (c.Item == null)
|
||||
continue;
|
||||
|
||||
float normalisedDepth = (float)(Math.Abs(selectedYPos - c.DrawYPosition) / maximumDistanceFromSelection);
|
||||
scroll.Panels.ChangeChildDepth(panel, normalisedDepth + c.Item.DepthLayer);
|
||||
float normalisedDepth = (float)(Math.Abs(selectedYPos - c.DrawYPosition) / DrawHeight);
|
||||
scroll.Panels.ChangeChildDepth(panel, c.Item.DepthLayer + normalisedDepth);
|
||||
|
||||
if (c.DrawYPosition != c.Item.CarouselYPosition)
|
||||
c.DrawYPosition = Interpolation.DampContinuously(c.DrawYPosition, c.Item.CarouselYPosition, 50, Time.Elapsed);
|
||||
|
@ -30,10 +30,9 @@ namespace osu.Game.Screens.SelectV2
|
||||
public float DrawHeight { get; set; } = DEFAULT_HEIGHT;
|
||||
|
||||
/// <summary>
|
||||
/// A number that defines the layer which this <see cref="CarouselItem"/> should be placed on depth-wise.
|
||||
/// The higher the number, the farther the panel associated with this item is taken to the background.
|
||||
/// Defines the display depth relative to other <see cref="CarouselItem"/>s.
|
||||
/// </summary>
|
||||
public int DepthLayer { get; set; } = 0;
|
||||
public int DepthLayer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether this item is visible or hidden.
|
||||
|
Loading…
Reference in New Issue
Block a user