1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Fix exception when order of objects changes

This commit is contained in:
smoogipoo 2018-11-19 16:19:56 +09:00
parent 4cbda97b1e
commit ce956d7fd4

View File

@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Screens.Edit.Compose.Components;
using OpenTK;
@ -34,7 +35,7 @@ namespace osu.Game.Rulesets.Mania.Edit
{
var hitObject = blueprint.HitObject;
var objectParent = hitObject.Parent;
var objectParent = (HitObjectContainer)hitObject.Parent;
// Using the hitobject position is required since AdjustPosition can be invoked multiple times per frame
// without the position having been updated by the parenting ScrollingHitObjectContainer
@ -49,10 +50,14 @@ namespace osu.Game.Rulesets.Mania.Edit
else
targetPosition = hitObject.Position.Y;
objectParent.Remove(hitObject);
hitObject.HitObject.StartTime = scrollingInfo.Algorithm.TimeAt(targetPosition,
editorClock.CurrentTime,
scrollingInfo.TimeRange.Value,
objectParent.DrawHeight);
objectParent.Add(hitObject);
}
adjustColumn(dragEvent);