1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 11:42:55 +08:00

Ensure the final scroll target is used when checking for whether too far down

This commit is contained in:
Dean Herbert 2021-08-20 17:56:35 +09:00
parent 03e6ca5ba9
commit 591ba8cb09

View File

@ -154,12 +154,13 @@ namespace osu.Game.Graphics.Containers
// implementation similar to ScrollIntoView but a bit more nuanced. // implementation similar to ScrollIntoView but a bit more nuanced.
float top = scrollContainer.GetChildPosInContent(target); float top = scrollContainer.GetChildPosInContent(target);
var bottomScrollExtent = scrollContainer.ScrollableExtent - fixedHeaderSize; float bottomScrollExtent = scrollContainer.ScrollableExtent - fixedHeaderSize;
float scrollTarget = top - fixedHeaderSize - scrollContainer.DisplayableContent * scroll_y_centre;
if (top > bottomScrollExtent) if (scrollTarget > bottomScrollExtent)
scrollContainer.ScrollToEnd(); scrollContainer.ScrollToEnd();
else else
scrollContainer.ScrollTo(top - fixedHeaderSize - scrollContainer.DisplayableContent * scroll_y_centre); scrollContainer.ScrollTo(scrollTarget);
if (target is T section) if (target is T section)
lastClickedSection = section; lastClickedSection = section;