mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 10:22:56 +08:00
Fix placing new match via right click not using original click position
This commit is contained in:
parent
b5f0d739e6
commit
b5c3e2a648
@ -76,6 +76,14 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
grid.Size = ScrollContent.Size + new Vector2(GRID_SPACING * 2);
|
||||
}
|
||||
|
||||
private Vector2 lastMatchesContainerMouseDownPosition;
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
lastMatchesContainerMouseDownPosition = MatchesContainer.ToLocalSpace(e.ScreenSpaceMouseDownPosition);
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
private void updateMessage()
|
||||
{
|
||||
rightClickMessage.Alpha = LadderInfo.Matches.Count > 0 ? 0 : 1;
|
||||
@ -97,7 +105,8 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
{
|
||||
new OsuMenuItem("Create new match", MenuItemType.Highlighted, () =>
|
||||
{
|
||||
Vector2 pos = MatchesContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position);
|
||||
Vector2 pos = lastMatchesContainerMouseDownPosition;
|
||||
|
||||
TournamentMatch newMatch = new TournamentMatch { Position = { Value = new Point((int)pos.X, (int)pos.Y) } };
|
||||
|
||||
LadderInfo.Matches.Add(newMatch);
|
||||
|
Loading…
Reference in New Issue
Block a user