1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 13:33:03 +08:00

Calculate content height automatically

This commit is contained in:
Dean Herbert 2020-10-13 15:32:37 +09:00
parent c08b5e8d03
commit 1da49073ab
2 changed files with 6 additions and 1 deletions

View File

@ -70,7 +70,6 @@ namespace osu.Game.Screens.Select.Carousel
Content.Add(beatmapContainer = new Container<DrawableCarouselItem> Content.Add(beatmapContainer = new Container<DrawableCarouselItem>
{ {
X = 100, X = 100,
Y = MAX_HEIGHT,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
}); });

View File

@ -20,6 +20,9 @@ namespace osu.Game.Screens.Select.Carousel
public readonly CarouselHeader Header; public readonly CarouselHeader Header;
/// <summary>
/// Optional content which sits below the header.
/// </summary>
protected readonly Container<Drawable> Content; protected readonly Container<Drawable> Content;
protected readonly Container MovementContainer; protected readonly Container MovementContainer;
@ -89,6 +92,9 @@ namespace osu.Game.Screens.Select.Carousel
{ {
base.LoadComplete(); base.LoadComplete();
// avoid using fill flow for performance reasons. header size doesn't change after load.
Content.Y = Header.Height;
UpdateItem(); UpdateItem();
} }