From 172d14bcc6675e042b7852845c6122222530c4c5 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 8 May 2022 11:40:14 -0700 Subject: [PATCH] Improve code quality of mod column flow container --- osu.Game/Overlays/Mods/ModSelectScreen.cs | 29 ++++------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectScreen.cs b/osu.Game/Overlays/Mods/ModSelectScreen.cs index fc06af3f9d..b232acf11b 100644 --- a/osu.Game/Overlays/Mods/ModSelectScreen.cs +++ b/osu.Game/Overlays/Mods/ModSelectScreen.cs @@ -12,7 +12,6 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; -using osu.Framework.Layout; using osu.Framework.Lists; using osu.Framework.Utils; using osu.Game.Audio; @@ -125,12 +124,15 @@ namespace osu.Game.Overlays.Mods ScrollbarOverlapsContent = false, Child = columnFlow = new ColumnFlowContainer { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, Direction = FillDirection.Horizontal, Shear = new Vector2(SHEAR, 0), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Spacing = new Vector2(10, 0), Margin = new MarginPadding { Horizontal = 70 }, + Padding = new MarginPadding { Bottom = 10 }, Children = new[] { createModColumnContent(ModType.DifficultyReduction, new[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P }), @@ -490,19 +492,12 @@ namespace osu.Game.Overlays.Mods } /// - /// Manages padding and layout of mod columns. + /// Manages layout of mod columns. /// internal class ColumnFlowContainer : FillFlowContainer { public IEnumerable Columns => Children.Select(dimWrapper => dimWrapper.Column); - private readonly LayoutValue drawSizeLayout = new LayoutValue(Invalidation.DrawSize); - - public ColumnFlowContainer() - { - AddLayout(drawSizeLayout); - } - public override void Add(ColumnDimContainer dimContainer) { base.Add(dimContainer); @@ -510,22 +505,6 @@ namespace osu.Game.Overlays.Mods Debug.Assert(dimContainer != null); dimContainer.Column.Shear = Vector2.Zero; } - - protected override void Update() - { - base.Update(); - - if (!drawSizeLayout.IsValid) - { - Padding = new MarginPadding - { - Left = DrawHeight * SHEAR, - Bottom = 10 - }; - - drawSizeLayout.Validate(); - } - } } ///