Fix incorrect insert logic

This commit is contained in:
Dean Herbert 2020-01-24 11:52:32 +09:00
parent c390348eab
commit 851b891285

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -33,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
private const int drawable_judgement_size = 8;
private const int spacing = 2;
private int runningDepth;
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
public JudgementFlow()
{
@ -47,7 +48,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
public void Push(Color4 colour)
{
Insert(runningDepth--, new DrawableResult(colour, drawable_judgement_size));
Add(new DrawableResult(colour, drawable_judgement_size));
if (Children.Count > max_available_judgements)
Children.FirstOrDefault(c => !c.IsRemoved)?.Remove();