mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Revert changes in SliderPath
This commit is contained in:
parent
3481c41a22
commit
0e691d5935
@ -202,7 +202,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
{
|
||||
ensureValid();
|
||||
|
||||
return segmentEnds.Select(i => cumulativeLength[i] / Distance);
|
||||
return segmentEnds.Select(i => cumulativeLength[i] / calculatedLength);
|
||||
}
|
||||
|
||||
private void invalidate()
|
||||
@ -251,9 +251,8 @@ namespace osu.Game.Rulesets.Objects
|
||||
calculatedPath.Add(t);
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
// Remember the index of the segment end
|
||||
segmentEnds.Add(calculatedPath.Count - 1);
|
||||
// Remember the index of the segment end
|
||||
segmentEnds.Add(calculatedPath.Count - 1);
|
||||
|
||||
// Start the new segment at the current vertex
|
||||
start = i;
|
||||
@ -315,11 +314,15 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
if (calculatedLength > expectedDistance)
|
||||
{
|
||||
// The path will be shortened further, in which case we should trim any more unnecessary lengths
|
||||
// The path will be shortened further, in which case we should trim any more unnecessary lengths and their associated path segments
|
||||
while (cumulativeLength.Count > 0 && cumulativeLength[^1] >= expectedDistance)
|
||||
{
|
||||
cumulativeLength.RemoveAt(cumulativeLength.Count - 1);
|
||||
calculatedPath.RemoveAt(pathEndIndex--);
|
||||
|
||||
// Shorten the last segment to the expected distance
|
||||
if (segmentEnds.Count > 0)
|
||||
segmentEnds[^1]--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,12 +339,6 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
calculatedPath[pathEndIndex] = calculatedPath[pathEndIndex - 1] + dir * (float)(expectedDistance - cumulativeLength[^1]);
|
||||
cumulativeLength.Add(expectedDistance);
|
||||
|
||||
// Shorten the segments to the expected distance
|
||||
for (int i = 0; i < segmentEnds.Count; i++)
|
||||
{
|
||||
segmentEnds[i] = Math.Min(segmentEnds[i], cumulativeLength.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user