mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 20:32:54 +08:00
Add comments explaining the usage of shiftNestedObjects()
This commit is contained in:
parent
a08a4aa911
commit
d5de5ae640
@ -90,12 +90,15 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
switch (hitObject)
|
switch (hitObject)
|
||||||
{
|
{
|
||||||
case Slider slider:
|
case Slider slider:
|
||||||
|
// Shift nested objects the same distance as the slider got shifted in the randomisation process
|
||||||
|
// so that moveSliderIntoPlayfield() can determine their relative distances to slider.Position and thus minMargin
|
||||||
shiftNestedObjects(slider, Vector2.Subtract(slider.Position, current.PositionOriginal));
|
shiftNestedObjects(slider, Vector2.Subtract(slider.Position, current.PositionOriginal));
|
||||||
|
|
||||||
var oldPos = new Vector2(slider.Position.X, slider.Position.Y);
|
var oldPos = new Vector2(slider.Position.X, slider.Position.Y);
|
||||||
|
|
||||||
moveSliderIntoPlayfield(slider, current);
|
moveSliderIntoPlayfield(slider, current);
|
||||||
|
|
||||||
|
// Shift them again to move them to their final position after the slider got moved into the playfield
|
||||||
shiftNestedObjects(slider, Vector2.Subtract(slider.Position, oldPos));
|
shiftNestedObjects(slider, Vector2.Subtract(slider.Position, oldPos));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user