mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 10:03:05 +08:00
Fix playfield getting cut off (again) at tall aspect ratios
This commit is contained in:
parent
f489dbd7a9
commit
b58354ac64
@ -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[]
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user