Extract header element from base DrawableCarouselItem class

This commit is contained in:
Dean Herbert
2020-10-13 15:19:32 +09:00
parent 2aad482545
commit cfec4f4fc1
5 changed files with 152 additions and 102 deletions

View File

@ -841,7 +841,7 @@ namespace osu.Game.Screens.Select
/// <param name="parent">For nested items, the parent of the item to be updated.</param>
private void updateItem(DrawableCarouselItem item, DrawableCarouselItem parent = null)
{
Vector2 posInScroll = scrollableContent.ToLocalSpace(item.ScreenSpaceDrawQuad.Centre);
Vector2 posInScroll = scrollableContent.ToLocalSpace(item.Header.ScreenSpaceDrawQuad.Centre);
float itemDrawY = posInScroll.Y - visibleUpperBound;
float dist = Math.Abs(1f - itemDrawY / visibleHalfHeight);