Replace manual calculations with std::lerp and std::midpoint

This commit is contained in:
Dr. Dystopia committed 2026-08-16 10:28:21 +02:00
1 parent 54070da585
commit eb956a158c
7 files changed
+23 -10

No files matched your search

@@ -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;
}