From eb956a158c76a0b7ebf19423d31ac91a31dc394e Mon Sep 17 00:00:00 2001 From: "Dr. Dystopia" Date: Fri, 31 Jul 2026 23:16:34 +0200 Subject: Replace manual calculations with std::lerp and std::midpoint --- Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface') 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 #include #include +#include #include #include @@ -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; } -- cgit v1.2.3