diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2026-10-31 02:04:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-31 02:04:42 -0500 |
| commit | 1f3086790122c49a7cda4ba04318dae568ab52f9 (patch) | |
| tree | f283462bbf5ffc755e2ddac7f004525e82c06afd /Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | |
| parent | dd5a544ddeb7ffeccfff9e45e6392ebb7f12e9a5 (diff) | |
| parent | eb956a158c76a0b7ebf19423d31ac91a31dc394e (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/evdev.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 3 |
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; } |
