MathHelper.Quantize uses round instead of floor

pull/48/head
cosmonaut 2023-03-09 13:52:45 -08:00
parent 1f0e3b5040
commit 455f4048df
1 changed files with 6 additions and 1 deletions

View File

@ -282,7 +282,12 @@ namespace MoonWorks.Math
public static float Quantize(float value, float step)
{
return (float) System.Math.Floor(value / step) * step;
return System.MathF.Round(value / step) * step;
}
public static Fixed.Fix64 Quantize(Fixed.Fix64 value, Fixed.Fix64 step)
{
return Fixed.Fix64.Round(value / step) * step;
}
/// <summary>