mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:43:04 +08:00
Fix drift when dragging chat beyond bounds
This commit is contained in:
parent
e67a00f1f6
commit
ed8b34d5ed
@ -135,17 +135,20 @@ namespace osu.Game.Overlays
|
||||
channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel;
|
||||
}
|
||||
|
||||
private double startDragChatHeight;
|
||||
|
||||
protected override bool OnDragStart(InputState state)
|
||||
{
|
||||
if (channelTabs.Hovering)
|
||||
return true;
|
||||
if (!channelTabs.Hovering)
|
||||
return base.OnDragStart(state);
|
||||
|
||||
return base.OnDragStart(state);
|
||||
startDragChatHeight = chatHeight.Value;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnDrag(InputState state)
|
||||
{
|
||||
chatHeight.Value = Height - state.Mouse.Delta.Y / Parent.DrawSize.Y;
|
||||
chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
|
||||
return base.OnDrag(state);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user