summaryrefslogtreecommitdiffhomepage
path: root/proto-mouse/ftnoir_protocol_mouse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-mouse/ftnoir_protocol_mouse.cpp')
-rw-r--r--proto-mouse/ftnoir_protocol_mouse.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/proto-mouse/ftnoir_protocol_mouse.cpp b/proto-mouse/ftnoir_protocol_mouse.cpp
index 68d0ef28..3245adf4 100644
--- a/proto-mouse/ftnoir_protocol_mouse.cpp
+++ b/proto-mouse/ftnoir_protocol_mouse.cpp
@@ -64,12 +64,11 @@ int mouse::get_delta(int val, int prev)
{
using std::abs;
- const int a = abs(val - prev), b = abs(val + prev), c = abs(val);
- if (c < a && c < b)
- return val;
- if (b < a && b < c)
+ const int a = abs(val - prev), b = abs(val + prev);
+ if (b < a)
return val + prev;
- return val - prev;
+ else
+ return val - prev;
}
int mouse::get_value(double val, double sensitivity, bool is_rotation)