Fix sliders not dragging correctly after snaking has begun

Closes #10278.
This commit is contained in:
Dean Herbert 2020-09-28 17:32:57 +09:00
parent 89c8fca3fa
commit 63b5b8b841
2 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,11 @@ public class SliderBodyPiece : BlueprintPiece<Slider>
{
private readonly ManualSliderBody body;
/// <summary>
/// Offset in absolute (local) coordinates from the start of the curve.
/// </summary>
public Vector2 PathStartLocation => body.PathOffset;
public SliderBodyPiece()
{
InternalChild = body = new ManualSliderBody

View File

@ -190,7 +190,7 @@ private void updatePath()
new OsuMenuItem("Add control point", MenuItemType.Standard, () => addControlPoint(rightClickPosition)),
};
public override Vector2 ScreenSpaceSelectionPoint => ((DrawableSlider)DrawableObject).HeadCircle.ScreenSpaceDrawQuad.Centre;
public override Vector2 ScreenSpaceSelectionPoint => BodyPiece.ToScreenSpace(BodyPiece.PathStartLocation);
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => BodyPiece.ReceivePositionalInputAt(screenSpacePos);