mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Fix ScrollToSelected being called in too many cases
This commit is contained in:
parent
df7e795aa3
commit
59dbca2612
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
root.AddChild(newSet);
|
root.AddChild(newSet);
|
||||||
|
|
||||||
applyActiveCriteria(false);
|
applyActiveCriteria(false, false);
|
||||||
|
|
||||||
//check if we can/need to maintain our current selection.
|
//check if we can/need to maintain our current selection.
|
||||||
if (hadSelection)
|
if (hadSelection)
|
||||||
@ -276,7 +276,7 @@ namespace osu.Game.Screens.Select
|
|||||||
public void FlushPendingFilterOperations()
|
public void FlushPendingFilterOperations()
|
||||||
{
|
{
|
||||||
if (FilterTask?.Completed == false)
|
if (FilterTask?.Completed == false)
|
||||||
applyActiveCriteria(false);
|
applyActiveCriteria(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Filter(FilterCriteria newCriteria, bool debounce = true)
|
public void Filter(FilterCriteria newCriteria, bool debounce = true)
|
||||||
@ -284,10 +284,10 @@ namespace osu.Game.Screens.Select
|
|||||||
if (newCriteria != null)
|
if (newCriteria != null)
|
||||||
activeCriteria = newCriteria;
|
activeCriteria = newCriteria;
|
||||||
|
|
||||||
applyActiveCriteria(debounce);
|
applyActiveCriteria(debounce, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyActiveCriteria(bool debounce)
|
private void applyActiveCriteria(bool debounce, bool scroll)
|
||||||
{
|
{
|
||||||
Action perform = delegate
|
Action perform = delegate
|
||||||
{
|
{
|
||||||
@ -296,7 +296,7 @@ namespace osu.Game.Screens.Select
|
|||||||
root.Filter(activeCriteria);
|
root.Filter(activeCriteria);
|
||||||
updateItems();
|
updateItems();
|
||||||
|
|
||||||
ScrollToSelected(false);
|
if (scroll) ScrollToSelected(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
FilterTask?.Cancel();
|
FilterTask?.Cancel();
|
||||||
@ -446,7 +446,7 @@ namespace osu.Game.Screens.Select
|
|||||||
computeYPositions();
|
computeYPositions();
|
||||||
|
|
||||||
// Remove all items that should no longer be on-screen
|
// Remove all items that should no longer be on-screen
|
||||||
scrollableContent.RemoveAll(delegate(DrawableCarouselItem p)
|
scrollableContent.RemoveAll(delegate (DrawableCarouselItem p)
|
||||||
{
|
{
|
||||||
float itemPosY = p.Position.Y;
|
float itemPosY = p.Position.Y;
|
||||||
bool remove = itemPosY < Current - p.DrawHeight || itemPosY > Current + drawHeight || !p.IsPresent;
|
bool remove = itemPosY < Current - p.DrawHeight || itemPosY > Current + drawHeight || !p.IsPresent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user