commit 0158648bfb858b9d8ad813a31ffce4d43a95c995
parent 816d59eda82961bb36c8df99f9826f14a21e9d14
Author: amin <dev@aminmesbah.com>
Date: Sun, 2 Jun 2019 22:37:26 +0000
Make wrap actually wrap, not just clamp
FossilOrigin-Name: a00ba25256fa8c8a7b0a1b5faf646c0ef5b7ad9a81e674b3fb8a6fdc80c478e4
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/am_math.h b/src/am_math.h
@@ -26,11 +26,11 @@ internal inline f32 math_wrap(f32 n, f32 min, f32 max)
{
if (n > max)
{
- return min;
+ return n - max;
}
else if (n < min)
{
- return max;
+ return n + max;
}
else
{