From 68d5e8affc69c6d219c85e220913a27749551035 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2024 18:50:40 +0900 Subject: [PATCH] Use a better constant for playfield positioning --- .../UI/TaikoPlayfieldAdjustmentContainer.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.cs index 9a5fc90a05..c10e505f50 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.cs @@ -28,6 +28,8 @@ namespace osu.Game.Rulesets.Taiko.UI base.Update(); const float base_relative_height = TaikoPlayfield.BASE_HEIGHT / 768; + // Matches stable, see https://github.com/peppy/osu-stable-reference/blob/7519cafd1823f1879c0d9c991ba0e5c7fd3bfa02/osu!/GameModes/Play/Rulesets/Taiko/RulesetTaiko.cs#L514 + const float base_position = 135f / 480f; float relativeHeight = base_relative_height; @@ -49,14 +51,7 @@ namespace osu.Game.Rulesets.Taiko.UI // Limit the maximum relative height of the playfield to one-third of available area to avoid it masking out on extreme resolutions. relativeHeight = Math.Min(relativeHeight, 1f / 3f); - // Position the taiko playfield exactly one playfield from the top of the screen, if there is enough space for it. - // Note that the relative height cannot exceed one-third - if that limit is hit, the playfield will be exactly centered. - float playfieldPosition = relativeHeight; - - // arbitrary offset to make playfield position match stable. - playfieldPosition += 0.022f; - - Y = playfieldPosition; + Y = base_position; Scale = new Vector2(Math.Max((Parent!.ChildSize.Y / 768f) * (relativeHeight / base_relative_height), 1f)); Width = 1 / Scale.X;