1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Fix incorrect spawning when scale adjustments are applied to child sprites

This commit is contained in:
Dean Herbert 2020-05-12 16:58:47 +09:00
parent c7d8793c1d
commit e28e89213f
2 changed files with 4 additions and 8 deletions

View File

@ -22,7 +22,8 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
AddStep("Load scroller", () => SetContents(() =>
new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.TaikoScroller), _ => Empty())
{
Clock = new FramedClock(clock)
Clock = new FramedClock(clock),
Height = 0.4f,
}));
AddToggleStep("Toggle passing", passing => this.ChildrenOfType<LegacyTaikoScroller>().ForEach(s => s.LastResult.Value =
new JudgementResult(null, new Judgement()) { Type = passing ? HitResult.Perfect : HitResult.Miss }));

View File

@ -64,13 +64,8 @@ namespace osu.Game.Rulesets.Taiko.Skinning
float currentX = (InternalChildren?.FirstOrDefault()?.X ?? 0) - (float)Clock.ElapsedFrameTime * 0.1f;
// ensure we have enough sprites
if (!wideEnough())
{
ClearInternal();
while (!wideEnough())
AddInternal(new ScrollerSprite { Passing = passing });
}
while (!wideEnough())
AddInternal(new ScrollerSprite { Passing = passing });
var first = InternalChildren.First();
var last = InternalChildren.Last();