Fix incorrect snaking on non-repeat sliders.

This commit is contained in:
Dean Herbert
2016-12-06 16:58:12 +09:00
parent d05a1ea1c5
commit 29d15c3ab8

View File

@ -93,26 +93,24 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
private void updateBody(int repeat, double progress) private void updateBody(int repeat, double progress)
{ {
double drawStartProgress = 0; double start = 0;
double drawEndProgress = MathHelper.Clamp((Time.Current - slider.StartTime + TIME_PREEMPT) / TIME_FADEIN, 0, 1); double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - TIME_PREEMPT)) / TIME_FADEIN, 0, 1) : 1;
if (repeat >= slider.RepeatCount - 1) if (repeat >= slider.RepeatCount - 1)
{ {
if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1)
{ {
drawStartProgress = 0; start = 0;
drawEndProgress = progress; end = snakingOut ? progress : 1;
} }
else else
{ {
drawStartProgress = progress; start = snakingOut ? progress : 0;
drawEndProgress = 1; end = 1;
} }
} }
body.SetRange( body.SetRange(start, end);
snakingOut ? drawStartProgress : 0,
snakingIn ? drawEndProgress : 1);
} }
protected override void Update() protected override void Update()