summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2026-10-31 02:04:42 -0500
committerGitHub <noreply@github.com>2026-10-31 02:04:42 -0500
commit1f3086790122c49a7cda4ba04318dae568ab52f9 (patch)
treef283462bbf5ffc755e2ddac7f004525e82c06afd /Source/Core/InputCommon/ControllerInterface/evdev
parentdd5a544ddeb7ffeccfff9e45e6392ebb7f12e9a5 (diff)
parenteb956a158c76a0b7ebf19423d31ac91a31dc394e (diff)
Merge pull request #14782 from tygyh/Core/Use-lerp-and-midpoint
Replace manual calculations with std::lerp and std::midpoint
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev')
-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;
}