1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 12:53:11 +08:00

Fix playfield getting cut off (again) at tall aspect ratios

This commit is contained in:
Dean Herbert 2023-07-21 15:20:19 +09:00
parent f489dbd7a9
commit b58354ac64
2 changed files with 13 additions and 13 deletions

View File

@ -62,12 +62,7 @@ namespace osu.Game.Rulesets.Osu.Edit
private void load()
{
// Give a bit of breathing room around the playfield content.
PlayfieldContentContainer.Padding = new MarginPadding
{
Vertical = 10,
// Intentionally use the left toolbox size for both sides to vertically centre the playfield.
Horizontal = TOOLBOX_CONTRACTED_SIZE_LEFT + 10,
};
PlayfieldContentContainer.Padding = new MarginPadding(10);
LayerBelowRuleset.AddRange(new Drawable[]
{

View File

@ -117,13 +117,10 @@ namespace osu.Game.Rulesets.Edit
{
PlayfieldContentContainer = new Container
{
Name = "Content",
Padding = new MarginPadding
{
Left = TOOLBOX_CONTRACTED_SIZE_LEFT,
Right = TOOLBOX_CONTRACTED_SIZE_RIGHT,
},
RelativeSizeAxes = Axes.Both,
Name = "Playfield content",
RelativeSizeAxes = Axes.Y,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
{
// layers below playfield
@ -240,6 +237,14 @@ namespace osu.Game.Rulesets.Edit
});
}
protected override void Update()
{
base.Update();
// Ensure that the playfield is always centered but also doesn't get cut off by toolboxes.
PlayfieldContentContainer.Width = Math.Max(1024, DrawWidth) - TOOLBOX_CONTRACTED_SIZE_RIGHT * 2;
}
public override Playfield Playfield => drawableRulesetWrapper.Playfield;
public override IEnumerable<DrawableHitObject> HitObjects => drawableRulesetWrapper.Playfield.AllHitObjects;