1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Merge pull request #12194 from peppy/fix-timeline-depth-ordering

Fix timeline not visually ordering hitobjects in a stable way
This commit is contained in:
Dan Balasescu 2021-03-29 21:31:56 +09:00 committed by GitHub
commit e6e29259c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -71,7 +71,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
// Put earlier blueprints towards the end of the list, so they handle input first
int i = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime);
return i == 0 ? CompareReverseChildID(x, y) : i;
if (i != 0) return i;
// Fall back to end time if the start time is equal.
i = yObj.HitObject.GetEndTime().CompareTo(xObj.HitObject.GetEndTime());
return i == 0 ? CompareReverseChildID(y, x) : i;
}
}
}

View File

@ -138,7 +138,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Stack<HitObject> currentConcurrentObjects = new Stack<HitObject>();
foreach (var b in SelectionBlueprints.OrderBy(b => b.HitObject.StartTime).ThenBy(b => b.HitObject.GetEndTime()))
foreach (var b in SelectionBlueprints.Reverse())
{
// remove objects from the stack as long as their end time is in the past.
while (currentConcurrentObjects.TryPeek(out HitObject hitObject))