1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 08:27:49 +08:00

Merge pull request #28288 from Hecatia-Lapislazuli/selection-mathing-slider-size

Fix path blueprint becoming desynced from slider path size
This commit is contained in:
Dan Balasescu 2024-05-24 00:19:34 +09:00 committed by GitHub
commit 863f7151e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 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;
@ -27,14 +28,16 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
public SliderBodyPiece()
{
InternalChild = body = new ManualSliderBody
{
AccentColour = Color4.Transparent
};
AutoSizeAxes = Axes.Both;
// SliderSelectionBlueprint relies on calling ReceivePositionalInputAt on this drawable to determine whether selection should occur.
// Without AlwaysPresent, a movement in a parent container (ie. the editor composer area resizing) could cause incorrect input handling.
AlwaysPresent = true;
InternalChild = body = new ManualSliderBody
{
AccentColour = Color4.Transparent
};
}
[BackgroundDependencyLoader]
@ -61,7 +64,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
body.SetVertices(vertices);
}
Size = body.Size;
OriginPosition = body.PathOffset;
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Graphics;
using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning.Default
@ -11,10 +12,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
/// </summary>
public partial class ManualSliderBody : SliderBody
{
public new void SetVertices(IReadOnlyList<Vector2> vertices)
public ManualSliderBody()
{
base.SetVertices(vertices);
Size = Path.Size;
AutoSizeAxes = Axes.Both;
}
public new void SetVertices(IReadOnlyList<Vector2> vertices) => base.SetVertices(vertices);
}
}