mirror of https://github.com/ppy/osu
Scroll to bottom.
This commit is contained in:
parent
aac4ba2baa
commit
cde660a8ef
|
@ -17,6 +17,7 @@ public class DrawableChannel : Container
|
|||
{
|
||||
private readonly Channel channel;
|
||||
private FlowContainer flow;
|
||||
private ScrollContainer scroll;
|
||||
|
||||
public DrawableChannel(Channel channel)
|
||||
{
|
||||
|
@ -36,7 +37,7 @@ public DrawableChannel(Channel channel)
|
|||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
},
|
||||
new ScrollContainer
|
||||
scroll = new ScrollContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
|
@ -77,6 +78,8 @@ private void newMessagesArrived(IEnumerable<Message> newMessages)
|
|||
|
||||
while (flow.Children.Count() > Channel.MAX_HISTORY)
|
||||
flow.Remove(flow.Children.First());
|
||||
|
||||
scroll.ScrollTo(flow.DrawHeight, false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue