mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Scroll chat line to channel center
We may eventually want that encapsulated within `ScrollIntoView`, as it would also come in handy for `GameplayLeaderboard`.
This commit is contained in:
@ -100,7 +100,8 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
if (chatLine != null)
|
||||
{
|
||||
scroll.ScrollIntoView(chatLine);
|
||||
float center = scroll.GetChildPosInContent(chatLine, chatLine.DrawSize / 2) - scroll.DisplayableContent / 2;
|
||||
scroll.ScrollTo(Math.Clamp(center, 0, scroll.ScrollableExtent));
|
||||
chatLine.ScheduleHighlight();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user