diff options
author | FeralChild64 <> | 2022-07-08 19:03:50 +0300 |
---|---|---|
committer | FeralChild64 <> | 2022-07-08 22:56:44 +0300 |
commit | 60b8d2e117f232d4845acaee4cb77dec926febcd (patch) | |
tree | 9869616cfc7cac0a0cf8ad46510aed818164ab56 | |
parent | 7553e1ba85ad6481e0cf9a6b427b87e6deff092c (diff) |
Handle mouse code review remarksfc/mouse-rework-2
-rw-r--r-- | src/ints/mouse_vmware.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ints/mouse_vmware.cpp b/src/ints/mouse_vmware.cpp index ecc918133..102516be1 100644 --- a/src/ints/mouse_vmware.cpp +++ b/src/ints/mouse_vmware.cpp @@ -76,8 +76,8 @@ static uint16_t scaled_x = 0x7fff; // absolute position scaled from 0 to 0xffff static uint16_t scaled_y = 0x7fff; // 0x7fff is a center position static int8_t wheel_counter = 0; // wheel movement counter -static float pos_x = 0.0; -static float pos_y = 0.0; +static float pos_x = 0.0f; +static float pos_y = 0.0f; // Speed measurement static auto time_start = std::chrono::steady_clock::now(); @@ -184,7 +184,7 @@ static void speed_update(const float x_rel, const float y_rel) // For the measurement duration require no more than 400 milliseconds // and at least 10 times the clock granularity constexpr uint32_t max_diff_ms = 400; - constexpr uint32_t min_diff_ms = std::min(static_cast<uint32_t>(1), + constexpr uint32_t min_diff_ms = std::max(static_cast<uint32_t>(1), static_cast<uint32_t>(period_ms * 10)); // Require at least 40 ticks of PIC emulator to pass |