mirror of
https://github.com/osukey/osukey.git
synced 2025-05-07 22:57:31 +09:00
Change SectionsContainer
to use flowing children for section update logic
This commit is contained in:
parent
d8d25c704f
commit
0497e433b1
@ -240,7 +240,9 @@ namespace osu.Game.Graphics.Containers
|
||||
headerBackgroundContainer.Height = expandableHeaderSize + fixedHeaderSize;
|
||||
headerBackgroundContainer.Y = ExpandableHeader?.Y ?? 0;
|
||||
|
||||
float smallestSectionHeight = Children.Count > 0 ? Children.Min(d => d.Height) : 0;
|
||||
var flowChildren = scrollContentContainer.FlowingChildren.OfType<T>();
|
||||
|
||||
float smallestSectionHeight = flowChildren.Any() ? flowChildren.Min(d => d.Height) : 0;
|
||||
|
||||
// scroll offset is our fixed header height if we have it plus 10% of content height
|
||||
// plus 5% to fix floating point errors and to not have a section instantly unselect when scrolling upwards
|
||||
@ -249,7 +251,7 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
float scrollCentre = fixedHeaderSize + scrollContainer.DisplayableContent * scroll_y_centre + selectionLenienceAboveSection;
|
||||
|
||||
var presentChildren = Children.Where(c => c.IsPresent);
|
||||
var presentChildren = flowChildren.Where(c => c.IsPresent);
|
||||
|
||||
if (lastClickedSection != null)
|
||||
SelectedSection.Value = lastClickedSection;
|
||||
|
Loading…
x
Reference in New Issue
Block a user