From c96c7a0d90c31dbd3653893cf29751daeca35a2f Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 29 Mar 2022 00:11:50 -0700 Subject: [PATCH] MathHelper.Approach should not return delta --- src/Math/MathHelper.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Math/MathHelper.cs b/src/Math/MathHelper.cs index 0431d80b..f53876c6 100644 --- a/src/Math/MathHelper.cs +++ b/src/Math/MathHelper.cs @@ -353,12 +353,11 @@ namespace MoonWorks.Math /// Start value. /// End value. /// Change value. - /// The final delta. public static float Approach(float start, float end, float change) { - return (start < end ? + return start < end ? System.Math.Min(start + change, end) : - System.Math.Max(start - change, end)) - start; + System.Math.Max(start - change, end); } #endregion