diff --git a/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs index e698e6e5b3..54aa83942d 100644 --- a/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; +using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Tournament.Components; using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Ladder; @@ -26,6 +27,8 @@ namespace osu.Game.Tournament.Screens.Editors [Cached] public partial class LadderEditorScreen : LadderScreen, IHasContextMenu { + public const float GRID_SPACING = 10; + [Cached] private LadderEditorInfo editorInfo = new LadderEditorInfo(); @@ -43,6 +46,13 @@ namespace osu.Game.Tournament.Screens.Editors AddInternal(rightClickMessage = new WarningBox("Right click to place and link matches")); + ScrollContent.Add(new RectangularPositionSnapGrid(Vector2.Zero) + { + Spacing = new Vector2(GRID_SPACING), + RelativeSizeAxes = Axes.Both, + Depth = float.MaxValue + }); + LadderInfo.Matches.CollectionChanged += (_, _) => updateMessage(); updateMessage(); } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs index d9e19ac2e5..4959f9ad29 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; using osu.Game.Tournament.Models; +using osu.Game.Tournament.Screens.Editors; using osuTK; using osuTK.Graphics; using osuTK.Input; @@ -44,8 +45,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components const float border_thickness = 4; const float spacing = 2; - Margin = new MarginPadding(border_thickness); - InternalChildren = new Drawable[] { Flow = new FillFlowContainer @@ -333,8 +332,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private Vector2 snapToGrid(Vector2 pos) => new Vector2( - (int)(pos.X / 10) * 10, - (int)(pos.Y / 10) * 10 + (int)(pos.X / LadderEditorScreen.GRID_SPACING) * LadderEditorScreen.GRID_SPACING, + (int)(pos.Y / LadderEditorScreen.GRID_SPACING) * LadderEditorScreen.GRID_SPACING ); public void Remove()