MathHelper.Approach should not return delta

pull/18/head
cosmonaut 2022-03-29 00:11:50 -07:00
parent f0d3dfccf9
commit c96c7a0d90
1 changed files with 2 additions and 3 deletions

View File

@ -353,12 +353,11 @@ namespace MoonWorks.Math
/// <param name="start">Start value.</param> /// <param name="start">Start value.</param>
/// <param name="end">End value.</param> /// <param name="end">End value.</param>
/// <param name="change">Change value.</param> /// <param name="change">Change value.</param>
/// <returns>The final delta.</returns>
public static float Approach(float start, float end, float change) public static float Approach(float start, float end, float change)
{ {
return (start < end ? return start < end ?
System.Math.Min(start + change, end) : System.Math.Min(start + change, end) :
System.Math.Max(start - change, end)) - start; System.Math.Max(start - change, end);
} }
#endregion #endregion