mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user