mirror of https://github.com/ppy/osu
Ensure `Slider.updateNestedPositions()` actually updates the position of all nesteds
This commit is contained in:
parent
766d2d2ad2
commit
1c23fd31d7
|
@ -204,6 +204,7 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok
|
|||
SpanStartTime = e.SpanStartTime,
|
||||
StartTime = e.Time,
|
||||
Position = Position + Path.PositionAt(e.PathProgress),
|
||||
PathProgress = e.PathProgress,
|
||||
StackHeight = StackHeight,
|
||||
});
|
||||
break;
|
||||
|
@ -236,6 +237,7 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok
|
|||
StartTime = StartTime + (e.SpanIndex + 1) * SpanDuration,
|
||||
Position = Position + Path.PositionAt(e.PathProgress),
|
||||
StackHeight = StackHeight,
|
||||
PathProgress = e.PathProgress,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -248,14 +250,27 @@ private void updateNestedPositions()
|
|||
{
|
||||
endPositionCache.Invalidate();
|
||||
|
||||
if (HeadCircle != null)
|
||||
HeadCircle.Position = Position;
|
||||
foreach (var nested in NestedHitObjects)
|
||||
{
|
||||
switch (nested)
|
||||
{
|
||||
case SliderHeadCircle headCircle:
|
||||
headCircle.Position = Position;
|
||||
break;
|
||||
|
||||
if (TailCircle != null)
|
||||
TailCircle.Position = EndPosition;
|
||||
case SliderTailCircle tailCircle:
|
||||
tailCircle.Position = EndPosition;
|
||||
break;
|
||||
|
||||
if (LastRepeat != null)
|
||||
LastRepeat.Position = RepeatCount % 2 == 0 ? Position : Position + Path.PositionAt(1);
|
||||
case SliderRepeat repeat:
|
||||
repeat.Position = Position + Path.PositionAt(repeat.PathProgress);
|
||||
break;
|
||||
|
||||
case SliderTick tick:
|
||||
tick.Position = Position + Path.PositionAt(tick.PathProgress);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void UpdateNestedSamples()
|
||||
|
|
|
@ -5,6 +5,8 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||
{
|
||||
public class SliderRepeat : SliderEndCircle
|
||||
{
|
||||
public double PathProgress { get; set; }
|
||||
|
||||
public SliderRepeat(Slider slider)
|
||||
: base(slider)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ public class SliderTick : OsuHitObject
|
|||
{
|
||||
public int SpanIndex { get; set; }
|
||||
public double SpanStartTime { get; set; }
|
||||
public double PathProgress { get; set; }
|
||||
|
||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue