mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Avoid usage of AutoSize for DrawableCarouselItems in general
This commit is contained in:
parent
cecdf14f53
commit
ded09b78cb
@ -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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user