Remove DrawableCarouselItem.Update updating of height

Marginal from a performance aspect, but reads better.
This commit is contained in:
Dean Herbert
2022-01-30 12:34:08 +09:00
parent e9f3e7f5cb
commit a06287e76a
2 changed files with 9 additions and 12 deletions

View File

@ -60,7 +60,7 @@ namespace osu.Game.Screens.Select.Carousel
}
}
protected DrawableCarouselItem()
protected DrawableCarouselItem(float headerHeight = MAX_HEIGHT)
{
RelativeSizeAxes = Axes.X;
@ -73,10 +73,14 @@ namespace osu.Game.Screens.Select.Carousel
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
Header = new CarouselHeader(),
Header = new CarouselHeader
{
Height = headerHeight,
},
Content = new Container
{
RelativeSizeAxes = Axes.Both,
Y = headerHeight,
}
}
},
@ -92,12 +96,6 @@ namespace osu.Game.Screens.Select.Carousel
UpdateItem();
}
protected override void Update()
{
base.Update();
Content.Y = Header.Height;
}
protected virtual void UpdateItem()
{
if (item == null)