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> beatmapContainer = new Container<DrawableCarouselItem>
{ {
X = 100, X = 100,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
AutoSizeAxes = Axes.Y,
ChildrenEnumerable = visibleBeatmaps ChildrenEnumerable = visibleBeatmaps
}; };

View File

@ -63,7 +63,6 @@ namespace osu.Game.Screens.Select.Carousel
protected DrawableCarouselItem() protected DrawableCarouselItem()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Alpha = 0; Alpha = 0;
@ -71,15 +70,13 @@ namespace osu.Game.Screens.Select.Carousel
{ {
MovementContainer = new Container MovementContainer = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
Header = new CarouselHeader(), Header = new CarouselHeader(),
Content = new Container Content = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
AutoSizeAxes = Axes.Y,
} }
} }
}, },
@ -123,6 +120,10 @@ namespace osu.Game.Screens.Select.Carousel
protected virtual void ApplyState() 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); Debug.Assert(Item != null);
switch (Item.State.Value) switch (Item.State.Value)