1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 04:32:57 +08:00

Changed Size to be handled by AutoSizeAxes

This commit is contained in:
Aurelian 2024-05-23 14:36:49 +02:00
parent c3a2a1361d
commit f17f70dca7
2 changed files with 7 additions and 19 deletions

View File

@ -3,6 +3,7 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Skinning.Default;
@ -41,6 +42,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
private void load(OsuColour colours)
{
body.BorderColour = colours.Yellow;
AutoSizeAxes = Axes.Both;
}
private int? lastVersion;
@ -64,17 +66,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
OriginPosition = body.PathOffset;
}
public override Vector2 Size
{
get
{
if (base.Size != body.Size)
Size = body.Size;
return base.Size;
}
set => base.Size = value;
}
public void RecyclePath() => body.RecyclePath();
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => body.ReceivePositionalInputAt(screenSpacePos);

View File

@ -2,6 +2,8 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning.Default
@ -13,15 +15,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public new void SetVertices(IReadOnlyList<Vector2> vertices) => base.SetVertices(vertices);
public override Vector2 Size
[BackgroundDependencyLoader]
private void load()
{
get
{
if (base.Size != Path.Size)
Size = Path.Size;
return base.Size;
}
set => base.Size = value;
AutoSizeAxes = Axes.Both;
}
}
}