Add some comments about logic

This commit is contained in:
ekrctb 2021-06-23 10:19:39 +09:00
parent 69c8865a04
commit 5a5cb39c9f
3 changed files with 4 additions and 3 deletions

View File

@ -38,6 +38,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints
case PlacementState.Active: case PlacementState.Active:
if (e.Button != MouseButton.Right) break; if (e.Button != MouseButton.Right) break;
// If the duration is negative, swap the start and the end time to make the duration positive.
if (HitObject.Duration < 0) if (HitObject.Duration < 0)
{ {
HitObject.StartTime = HitObject.EndTime; HitObject.StartTime = HitObject.EndTime;

View File

@ -21,14 +21,13 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
public TimeSpanOutline() public TimeSpanOutline()
{ {
Anchor = Anchor.BottomLeft; Anchor = Origin = Anchor.BottomLeft;
Origin = Anchor.BottomLeft;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Masking = true; Masking = true;
BorderThickness = border_width; BorderThickness = border_width;
// a box is needed to make edge visible // A box is needed to make the border visible.
InternalChild = new Box InternalChild = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Catch.Edit
// TODO: confine in bounds // TODO: confine in bounds
hitObject.OriginalXBindable.Value += deltaX; hitObject.OriginalXBindable.Value += deltaX;
// Move the nested hit objects to give an instant result before nested objects are recreated.
foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>()) foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>())
nested.OriginalXBindable.Value += deltaX; nested.OriginalXBindable.Value += deltaX;
}); });