mirror of https://github.com/ppy/osu
Ensure the final scroll target is used when checking for whether too far down
This commit is contained in:
parent
03e6ca5ba9
commit
591ba8cb09
|
@ -154,12 +154,13 @@ public void ScrollTo(Drawable target)
|
|||
// implementation similar to ScrollIntoView but a bit more nuanced.
|
||||
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();
|
||||
else
|
||||
scrollContainer.ScrollTo(top - fixedHeaderSize - scrollContainer.DisplayableContent * scroll_y_centre);
|
||||
scrollContainer.ScrollTo(scrollTarget);
|
||||
|
||||
if (target is T section)
|
||||
lastClickedSection = section;
|
||||
|
|
Loading…
Reference in New Issue