From f96731ea8a3352f8a6d082e0b3119b706d3236ba Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 20 Sep 2017 21:39:55 -0500 Subject: [PATCH] Correct reverse smoothing buffer traversal --- DS4Windows/DS4Control/MouseCursor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 0d5b2e9..5cd1edd 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -139,7 +139,7 @@ namespace DS4Windows int idx = 0; for (int i = 0; i < SMOOTH_BUFFER_LEN; i++) { - idx = Math.Abs(smoothBufferTail - i - 1) % SMOOTH_BUFFER_LEN; + idx = (smoothBufferTail - i - 1 + SMOOTH_BUFFER_LEN) % SMOOTH_BUFFER_LEN; x_out += xSmoothBuffer[idx] * currentWeight; y_out += ySmoothBuffer[idx] * currentWeight; finalWeight += currentWeight;