Skip to content

Commit

Permalink
Make draw height precomputed
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jan 22, 2025
1 parent 8002812 commit 222401b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions osu.Game/Screens/SelectV2/BeatmapCarouselFilterGrouping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public async Task<IEnumerable<CarouselItem>> Run(IEnumerable<CarouselItem> items
newItems.Add(new CarouselItem(b.BeatmapSet!)
{
IsHeader = true,
DrawHeight = 80,
IsGroupSelectionTarget = true
});
}
Expand Down
6 changes: 4 additions & 2 deletions osu.Game/Screens/SelectV2/CarouselItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace osu.Game.Screens.SelectV2
/// </summary>
public sealed class CarouselItem : IComparable<CarouselItem>
{
public const float DEFAULT_HEIGHT = 40;

/// <summary>
/// The model this item is representing.
/// </summary>
Expand All @@ -23,9 +25,9 @@ public sealed class CarouselItem : IComparable<CarouselItem>
public double CarouselYPosition { get; set; }

/// <summary>
/// The height this item will take when displayed.
/// The height this item will take when displayed. Defaults to <see cref="DEFAULT_HEIGHT"/>.
/// </summary>
public float DrawHeight => IsHeader ? 80 : 40;
public float DrawHeight { get; set; } = DEFAULT_HEIGHT;

/// <summary>
/// Whether this item is a group header.
Expand Down

0 comments on commit 222401b

Please sign in to comment.