mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Simplify vertical position calculations by including spacing in height definition
This commit is contained in:
parent
b1ddb08a4e
commit
69650c16fc
@ -775,7 +775,7 @@ namespace osu.Game.Screens.Select
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollTarget += b.TotalHeight + DrawableCarouselBeatmap.CAROUSEL_BEATMAP_SPACING;
|
scrollTarget += b.TotalHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
switch (State.Value)
|
switch (State.Value)
|
||||||
{
|
{
|
||||||
case CarouselItemState.Selected:
|
case CarouselItemState.Selected:
|
||||||
return DrawableCarouselBeatmapSet.HEIGHT + Children.Count(c => c.Visible) * (DrawableCarouselBeatmap.CAROUSEL_BEATMAP_SPACING + DrawableCarouselBeatmap.HEIGHT);
|
return DrawableCarouselBeatmapSet.HEIGHT + Children.Count(c => c.Visible) * DrawableCarouselBeatmap.HEIGHT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DrawableCarouselBeatmapSet.HEIGHT;
|
return DrawableCarouselBeatmapSet.HEIGHT;
|
||||||
|
@ -33,7 +33,12 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
{
|
{
|
||||||
public const float CAROUSEL_BEATMAP_SPACING = 5;
|
public const float CAROUSEL_BEATMAP_SPACING = 5;
|
||||||
|
|
||||||
public const float HEIGHT = MAX_HEIGHT * 0.6f; // TODO: add once base class is fixed + CAROUSEL_BEATMAP_SPACING;
|
/// <summary>
|
||||||
|
/// The height of a carousel beatmap, including vertical spacing.
|
||||||
|
/// </summary>
|
||||||
|
public const float HEIGHT = height + CAROUSEL_BEATMAP_SPACING;
|
||||||
|
|
||||||
|
private const float height = MAX_HEIGHT * 0.6f;
|
||||||
|
|
||||||
private readonly BeatmapInfo beatmap;
|
private readonly BeatmapInfo beatmap;
|
||||||
|
|
||||||
@ -70,7 +75,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(BeatmapManager manager, SongSelect songSelect)
|
private void load(BeatmapManager manager, SongSelect songSelect)
|
||||||
{
|
{
|
||||||
Header.Height = HEIGHT;
|
Header.Height = height;
|
||||||
|
|
||||||
if (songSelect != null)
|
if (songSelect != null)
|
||||||
{
|
{
|
||||||
|
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
foreach (var panel in beatmapContainer.Children)
|
foreach (var panel in beatmapContainer.Children)
|
||||||
{
|
{
|
||||||
panel.MoveToY(yPos, 800, Easing.OutQuint);
|
panel.MoveToY(yPos, 800, Easing.OutQuint);
|
||||||
yPos += panel.Item.TotalHeight + DrawableCarouselBeatmap.CAROUSEL_BEATMAP_SPACING;
|
yPos += panel.Item.TotalHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user