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

SliderBody's Size getter updates size to the body/path's Size

This commit is contained in:
Aurelian 2024-05-22 10:39:42 +02:00
parent 3a608aa815
commit c3a2a1361d
2 changed files with 21 additions and 4 deletions

View File

@ -61,10 +61,20 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
body.SetVertices(vertices);
}
Size = body.Size;
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

@ -11,10 +11,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
/// </summary>
public partial class ManualSliderBody : SliderBody
{
public new void SetVertices(IReadOnlyList<Vector2> vertices)
public new void SetVertices(IReadOnlyList<Vector2> vertices) => base.SetVertices(vertices);
public override Vector2 Size
{
base.SetVertices(vertices);
Size = Path.Size;
get
{
if (base.Size != Path.Size)
Size = Path.Size;
return base.Size;
}
set => base.Size = value;
}
}
}