Apply rounding to ModTimeRamp to improve SPM consistency

This commit is contained in:
Bartłomiej Dach 2021-02-07 19:02:09 +01:00
parent 0e1ec703d3
commit 0229851c9c
1 changed files with 3 additions and 1 deletions

View File

@ -79,7 +79,9 @@ public double ApplyToRate(double time, double rate = 1)
{
double amount = (time - beginRampTime) / Math.Max(1, finalRateTime - beginRampTime);
double ramp = InitialRate.Value + (FinalRate.Value - InitialRate.Value) * Math.Clamp(amount, 0, 1);
return rate * ramp;
// round the end result to match the bindable SpeedChange's precision, in case this is called externally.
return rate * Math.Round(ramp, 2);
}
public virtual void Update(Playfield playfield)