summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
diff options
context:
space:
mode:
authorDr. Dystopia <jonis9898@hotmail.com>2026-07-31 23:16:34 +0200
committerDr. Dystopia <jonis9898@hotmail.com>2026-08-16 10:28:21 +0200
commiteb956a158c76a0b7ebf19423d31ac91a31dc394e (patch)
tree2ef18e6c3e558b3bb58c98404789df322e2a3afa /Source/Core/InputCommon
parent54070da5851e12f2d1a4389daa528e4fb81327ce (diff)
Replace manual calculations with std::lerp and std::midpoint
Diffstat (limited to 'Source/Core/InputCommon')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index 0f6730720f..c8fa7b3647 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -7,6 +7,7 @@
#include <cstring>
#include <map>
#include <memory>
+#include <numeric>
#include <string>
#include <fcntl.h>
@@ -177,7 +178,7 @@ public:
const int min = libevdev_get_abs_minimum(m_dev, m_code);
const int max = libevdev_get_abs_maximum(m_dev, m_code);
- m_base = (max + min) / 2;
+ m_base = std::midpoint(min, max);
m_range = (upper ? max : min) - m_base;
}