mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
revert slider radius parameter addition
This commit is contained in:
parent
f54a68f6ca
commit
6e883a69d9
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
if (WorkingHitObject.HitObject is Slider slider)
|
if (WorkingHitObject.HitObject is Slider slider)
|
||||||
{
|
{
|
||||||
var possibleMovementBounds = OsuHitObjectGenerationUtils.CalculatePossibleMovementBounds(slider, false);
|
var possibleMovementBounds = OsuHitObjectGenerationUtils.CalculatePossibleMovementBounds(slider);
|
||||||
|
|
||||||
x = possibleMovementBounds.Width < 0
|
x = possibleMovementBounds.Width < 0
|
||||||
? x
|
? x
|
||||||
|
@ -213,12 +213,11 @@ namespace osu.Game.Rulesets.Osu.Utils
|
|||||||
/// such that the entire slider is inside the playfield.
|
/// such that the entire slider is inside the playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slider">The <see cref="Slider"/> for which to calculate a movement bounding box.</param>
|
/// <param name="slider">The <see cref="Slider"/> for which to calculate a movement bounding box.</param>
|
||||||
/// <param name="accountForFollowCircleRadius">Whether the movement bounding box should account for the slider's follow circle. Defaults to true.</param>
|
|
||||||
/// <returns>A <see cref="RectangleF"/> which contains all of the possible movements of the slider such that the entire slider is inside the playfield.</returns>
|
/// <returns>A <see cref="RectangleF"/> which contains all of the possible movements of the slider such that the entire slider is inside the playfield.</returns>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// If the slider is larger than the playfield, the returned <see cref="RectangleF"/> may have negative width/height.
|
/// If the slider is larger than the playfield, the returned <see cref="RectangleF"/> may have negative width/height.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static RectangleF CalculatePossibleMovementBounds(Slider slider, bool accountForFollowCircleRadius = true)
|
public static RectangleF CalculatePossibleMovementBounds(Slider slider)
|
||||||
{
|
{
|
||||||
var pathPositions = new List<Vector2>();
|
var pathPositions = new List<Vector2>();
|
||||||
slider.Path.GetPathToProgress(pathPositions, 0, 1);
|
slider.Path.GetPathToProgress(pathPositions, 0, 1);
|
||||||
@ -239,17 +238,14 @@ namespace osu.Game.Rulesets.Osu.Utils
|
|||||||
maxY = MathF.Max(maxY, pos.Y);
|
maxY = MathF.Max(maxY, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accountForFollowCircleRadius)
|
// Take the circle radius into account.
|
||||||
{
|
float radius = (float)slider.Radius;
|
||||||
// Take the circle radius into account.
|
|
||||||
float radius = (float)slider.Radius;
|
|
||||||
|
|
||||||
minX -= radius;
|
minX -= radius;
|
||||||
minY -= radius;
|
minY -= radius;
|
||||||
|
|
||||||
maxX += radius;
|
maxX += radius;
|
||||||
maxY += radius;
|
maxY += radius;
|
||||||
}
|
|
||||||
|
|
||||||
// Given the bounding box of the slider (via min/max X/Y),
|
// Given the bounding box of the slider (via min/max X/Y),
|
||||||
// the amount that the slider can move to the left is minX (with the sign flipped, since positive X is to the right),
|
// the amount that the slider can move to the left is minX (with the sign flipped, since positive X is to the right),
|
||||||
|
Loading…
Reference in New Issue
Block a user