1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Make hit objects put in ScrollingContainers strictly ordered by start time

This won't change anything as is since all hit objects are given a depth at the moment.
This commit is contained in:
smoogipooo 2017-08-22 20:51:20 +09:00
parent 4c66a20d4e
commit db27551709

View File

@ -45,18 +45,15 @@ namespace osu.Game.Rulesets.Timing
RelativePositionAxes = Axes.Both;
}
public override void InvalidateFromChild(Invalidation invalidation)
protected override int Compare(Drawable x, Drawable y)
{
// We only want to re-compute our size when a child's size or position has changed
if ((invalidation & Invalidation.RequiredParentSizeToFit) == 0)
{
base.InvalidateFromChild(invalidation);
return;
}
var hX = (DrawableHitObject)x;
var hY = (DrawableHitObject)y;
durationBacking.Invalidate();
base.InvalidateFromChild(invalidation);
int result = hY.HitObject.StartTime.CompareTo(hX.HitObject.StartTime);
if (result != 0)
return result;
return base.Compare(y, x);
}
private double computeDuration()