mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
add fields for path's end location
This commit is contained in:
parent
ceedc3f934
commit
38bb7ac0c7
@ -22,6 +22,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
/// </summary>
|
||||
public Vector2 PathStartLocation => body.PathOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in absolute (local) coordinates from the end of the curve.
|
||||
/// </summary>
|
||||
public Vector2 PathEndLocation => body.PathEndOffset;
|
||||
public SliderBodyPiece()
|
||||
{
|
||||
InternalChild = body = new ManualSliderBody
|
||||
|
@ -31,6 +31,12 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
/// </summary>
|
||||
public virtual Vector2 PathOffset => path.PositionInBoundingBox(path.Vertices[0]);
|
||||
|
||||
/// <summary>
|
||||
/// Offset in absolute coordinates from the end of the curve.
|
||||
/// </summary>
|
||||
public virtual Vector2 PathEndOffset => path.PositionInBoundingBox(path.Vertices[^1]);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to colour the path.
|
||||
/// </summary>
|
||||
|
@ -43,6 +43,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
public override Vector2 PathOffset => snakedPathOffset;
|
||||
|
||||
public override Vector2 PathEndOffset => snakedPathEndOffset;
|
||||
|
||||
/// <summary>
|
||||
/// The top-left position of the path when fully snaked.
|
||||
/// </summary>
|
||||
@ -53,6 +55,11 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
/// </summary>
|
||||
private Vector2 snakedPathOffset;
|
||||
|
||||
/// <summary>
|
||||
/// The offset of the end of path from <see cref="snakedPosition"/> when fully snaked.
|
||||
/// </summary>
|
||||
private Vector2 snakedPathEndOffset;
|
||||
|
||||
private DrawableSlider drawableSlider = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -109,6 +116,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
snakedPosition = Path.PositionInBoundingBox(Vector2.Zero);
|
||||
snakedPathOffset = Path.PositionInBoundingBox(Path.Vertices[0]);
|
||||
snakedPathEndOffset = Path.PositionInBoundingBox(Path.Vertices[^1]);
|
||||
|
||||
double lastSnakedStart = SnakedStart ?? 0;
|
||||
double lastSnakedEnd = SnakedEnd ?? 0;
|
||||
|
Loading…
Reference in New Issue
Block a user