1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:43:10 +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; 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 var hX = (DrawableHitObject)x;
if ((invalidation & Invalidation.RequiredParentSizeToFit) == 0) var hY = (DrawableHitObject)y;
{
base.InvalidateFromChild(invalidation);
return;
}
durationBacking.Invalidate(); int result = hY.HitObject.StartTime.CompareTo(hX.HitObject.StartTime);
if (result != 0)
base.InvalidateFromChild(invalidation); return result;
return base.Compare(y, x);
} }
private double computeDuration() private double computeDuration()