From 1da49073abd01ec14b84b3e32c9fa353eae7d738 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 13 Oct 2020 15:32:37 +0900 Subject: [PATCH] Calculate content height automatically --- .../Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs | 1 - osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index 64a990a27d..b83915e0c6 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -70,7 +70,6 @@ namespace osu.Game.Screens.Select.Carousel Content.Add(beatmapContainer = new Container { X = 100, - Y = MAX_HEIGHT, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, }); diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs index 6a9b60fa57..5bcaffa3cf 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs @@ -20,6 +20,9 @@ namespace osu.Game.Screens.Select.Carousel public readonly CarouselHeader Header; + /// + /// Optional content which sits below the header. + /// protected readonly Container Content; protected readonly Container MovementContainer; @@ -89,6 +92,9 @@ namespace osu.Game.Screens.Select.Carousel { base.LoadComplete(); + // avoid using fill flow for performance reasons. header size doesn't change after load. + Content.Y = Header.Height; + UpdateItem(); }