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

Avoid usage of AutoSize for DrawableCarouselItems in general

This commit is contained in:
Dean Herbert 2020-10-13 16:33:37 +09:00
parent cecdf14f53
commit ded09b78cb
2 changed files with 7 additions and 7 deletions

View File

@ -192,8 +192,7 @@ namespace osu.Game.Screens.Select.Carousel
beatmapContainer = new Container<DrawableCarouselItem>
{
X = 100,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.Both,
ChildrenEnumerable = visibleBeatmaps
};

View File

@ -63,7 +63,6 @@ namespace osu.Game.Screens.Select.Carousel
protected DrawableCarouselItem()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Alpha = 0;
@ -71,15 +70,13 @@ namespace osu.Game.Screens.Select.Carousel
{
MovementContainer = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
Header = new CarouselHeader(),
Content = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.Both,
}
}
},
@ -123,6 +120,10 @@ namespace osu.Game.Screens.Select.Carousel
protected virtual void ApplyState()
{
// Use the fact that we know the precise height of the item from the model to avoid the need for AutoSize overhead.
// Additionally, AutoSize doesn't work well due to content starting off-screen and being masked away.
Height = Item.TotalHeight;
Debug.Assert(Item != null);
switch (Item.State.Value)