1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 19:53:23 +08:00

Added comments

This commit is contained in:
Henry Lin 2021-06-29 12:56:05 +08:00
parent 96e09605d8
commit 0c5777c2c8

View File

@ -89,6 +89,7 @@ namespace osu.Game.Rulesets.Osu.Mods
for (int j = i - 1; j >= i - shift_object_count && j >= 0; j--) for (int j = i - 1; j >= i - shift_object_count && j >= 0; j--)
{ {
// only shift hit circles
if (!(hitObjects[j] is HitCircle)) break; if (!(hitObjects[j] is HitCircle)) break;
toBeShifted.Add(hitObjects[j]); toBeShifted.Add(hitObjects[j]);
@ -184,6 +185,8 @@ namespace osu.Game.Rulesets.Osu.Mods
{ {
for (int i = 0; i < hitObjects.Count; i++) for (int i = 0; i < hitObjects.Count; i++)
{ {
// The first object is shifted by a vector slightly smaller than shift
// The last object is shifted by a vector slightly larger than zero
Vector2 position = hitObjects[i].Position + shift * ((hitObjects.Count - i) / (float)(hitObjects.Count + 1)); Vector2 position = hitObjects[i].Position + shift * ((hitObjects.Count - i) / (float)(hitObjects.Count + 1));
position.X = MathHelper.Clamp(position.X, 0, OsuPlayfield.BASE_SIZE.X); position.X = MathHelper.Clamp(position.X, 0, OsuPlayfield.BASE_SIZE.X);