1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Add inline comments and use Vector2.Zero

This commit is contained in:
Dean Herbert 2021-03-30 14:13:16 +09:00
parent eda45e0e28
commit b82247aabe

View File

@ -39,9 +39,11 @@ namespace osu.Game.Rulesets.Osu.Edit
{ {
var hitObjects = selectedMovableObjects; var hitObjects = selectedMovableObjects;
// this will potentially move the selection out of bounds...
foreach (var h in hitObjects) foreach (var h in hitObjects)
h.Position += moveEvent.InstantDelta; h.Position += moveEvent.InstantDelta;
// but this will be corrected.
moveSelectionInBounds(); moveSelectionInBounds();
return true; return true;
} }
@ -153,7 +155,6 @@ namespace osu.Game.Rulesets.Osu.Edit
scaleHitObjects(hitObjects, reference, scale); scaleHitObjects(hitObjects, reference, scale);
moveSelectionInBounds(); moveSelectionInBounds();
return true; return true;
} }
@ -257,7 +258,8 @@ namespace osu.Game.Rulesets.Osu.Edit
var hitObjects = selectedMovableObjects; var hitObjects = selectedMovableObjects;
Quad quad = getSurroundingQuad(hitObjects); Quad quad = getSurroundingQuad(hitObjects);
Vector2 delta = new Vector2(0);
Vector2 delta = Vector2.Zero;
if (quad.TopLeft.X < 0) if (quad.TopLeft.X < 0)
delta.X -= quad.TopLeft.X; delta.X -= quad.TopLeft.X;