1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:02:53 +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() private void load()
{ {
// Give a bit of breathing room around the playfield content. // Give a bit of breathing room around the playfield content.
PlayfieldContentContainer.Padding = new MarginPadding PlayfieldContentContainer.Padding = new MarginPadding(10);
{
Vertical = 10,
// Intentionally use the left toolbox size for both sides to vertically centre the playfield.
Horizontal = TOOLBOX_CONTRACTED_SIZE_LEFT + 10,
};
LayerBelowRuleset.AddRange(new Drawable[] LayerBelowRuleset.AddRange(new Drawable[]
{ {

View File

@ -117,13 +117,10 @@ namespace osu.Game.Rulesets.Edit
{ {
PlayfieldContentContainer = new Container PlayfieldContentContainer = new Container
{ {
Name = "Content", Name = "Playfield content",
Padding = new MarginPadding RelativeSizeAxes = Axes.Y,
{ Anchor = Anchor.Centre,
Left = TOOLBOX_CONTRACTED_SIZE_LEFT, Origin = Anchor.Centre,
Right = TOOLBOX_CONTRACTED_SIZE_RIGHT,
},
RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
// layers below playfield // 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 Playfield Playfield => drawableRulesetWrapper.Playfield;
public override IEnumerable<DrawableHitObject> HitObjects => drawableRulesetWrapper.Playfield.AllHitObjects; public override IEnumerable<DrawableHitObject> HitObjects => drawableRulesetWrapper.Playfield.AllHitObjects;