diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs
index 63fda42393..de7309c27f 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs
@@ -52,12 +52,12 @@ namespace osu.Game.Rulesets.Osu.Mods
public bool DisplayResultsOnFail => true;
///
- /// Jump distance for circles in the last combo
+ /// Jump distance for circles in the last combo
///
private const float max_base_distance = 250f;
///
- /// The maximum allowed jump distance after multipliers are applied
+ /// The maximum allowed jump distance after multipliers are applied
///
private const float distance_cap = 350f;
@@ -67,7 +67,12 @@ namespace osu.Game.Rulesets.Osu.Mods
private const byte border_distance_y = 144;
///
- /// Duration of the undimming animation
+ /// The extent of rotation towards playfield centre when a circle is near the edge
+ ///
+ private const float edge_rotation_multiplier = 0.75f;
+
+ ///
+ /// Duration of the undimming animation
///
private const double undim_duration = 96;
@@ -295,14 +300,16 @@ namespace osu.Game.Rulesets.Osu.Mods
var newPosition = Vector2.Add(lastPos, relativePos);
- if (newPosition.Y < 0)
- newPosition.Y = 0;
- else if (newPosition.Y > OsuPlayfield.BASE_SIZE.Y)
- newPosition.Y = OsuPlayfield.BASE_SIZE.Y;
- if (newPosition.X < 0)
- newPosition.X = 0;
- else if (newPosition.X > OsuPlayfield.BASE_SIZE.X)
- newPosition.X = OsuPlayfield.BASE_SIZE.X;
+ var radius = (float)obj.Radius;
+
+ if (newPosition.Y < radius)
+ newPosition.Y = radius;
+ else if (newPosition.Y > OsuPlayfield.BASE_SIZE.Y - radius)
+ newPosition.Y = OsuPlayfield.BASE_SIZE.Y - radius;
+ if (newPosition.X < radius)
+ newPosition.X = radius;
+ else if (newPosition.X > OsuPlayfield.BASE_SIZE.X - radius)
+ newPosition.X = OsuPlayfield.BASE_SIZE.X - radius;
obj.Position = newPosition;
@@ -314,10 +321,10 @@ namespace osu.Game.Rulesets.Osu.Mods
}
///
- /// Get samples (if any) for a specific point in time.
+ /// Get samples (if any) for a specific point in time.
///
///
- /// Samples will be returned if a hit circle or a slider node exists at that point of time.
+ /// Samples will be returned if a hit circle or a slider node exists at that point of time.
///
/// The list of hit objects in a beatmap, ordered by StartTime
/// The point in time to get samples for
@@ -349,7 +356,7 @@ namespace osu.Game.Rulesets.Osu.Mods
}
///
- /// Determines the position of the current hit object relative to the previous one.
+ /// Determines the position of the current hit object relative to the previous one.
///
/// The position of the current hit object relative to the previous one
private Vector2 getRotatedVector(Vector2 prevPosChanged, Vector2 posRelativeToPrev)
@@ -390,18 +397,18 @@ namespace osu.Game.Rulesets.Osu.Mods
return rotateVectorTowardsVector(
posRelativeToPrev,
Vector2.Subtract(playfieldMiddle, prevPosChanged),
- Math.Min(1, relativeRotationDistance * 0.75f)
+ Math.Min(1, relativeRotationDistance * edge_rotation_multiplier)
);
}
///
- /// Rotates vector "initial" towards vector "destination"
+ /// Rotates vector "initial" towards vector "destination"
///
/// Vector to rotate to "destination"
/// Vector "initial" should be rotated to
///
- /// The angle the vector should be rotated relative to the difference between the angles of
- /// the the two vectors.
+ /// The angle the vector should be rotated relative to the difference between the angles of
+ /// the the two vectors.
///
/// Resulting vector
private Vector2 rotateVectorTowardsVector(Vector2 initial, Vector2 destination, float relativeDistance)