From c3a2a1361d045dbfd7c409fcd003ddc33dd54164 Mon Sep 17 00:00:00 2001 From: Aurelian Date: Wed, 22 May 2024 10:39:42 +0200 Subject: [PATCH] SliderBody's Size getter updates size to the body/path's Size --- .../Sliders/Components/SliderBodyPiece.cs | 12 +++++++++++- .../Skinning/Default/ManualSliderBody.cs | 13 ++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs index 075e9e6aa1..14d72a2d36 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs @@ -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); diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs index d171f56f40..99d954059c 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Default/ManualSliderBody.cs @@ -11,10 +11,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default /// public partial class ManualSliderBody : SliderBody { - public new void SetVertices(IReadOnlyList vertices) + public new void SetVertices(IReadOnlyList 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; } } }