From 0334ddc2e5ac7ffd4b9ab0d7d10f7c0cbffbed96 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 6 Jul 2023 07:05:04 +0200 Subject: [PATCH] early-access version 3742 --- README.md | 2 +- src/input_common/drivers/mouse.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ae44cc87a..d879d24f9 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3741. +This is the source code for early-access 3742. ## Legal Notice diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index 0e06c7b05..79876b427 100755 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp @@ -160,8 +160,9 @@ void Mouse::Move(int x, int y, int center_x, int center_y) { last_mouse_change.y += mouse_change.y * y_sensitivity; // Bind the mouse change to [0 <= deadzone_counterweight <= 1.0] - if (last_mouse_change.Length() < deadzone_counterweight) { - last_mouse_change /= last_mouse_change.Length(); + const float length = last_mouse_change.Length(); + if (length < deadzone_counterweight && length != 0.0f) { + last_mouse_change /= length; last_mouse_change *= deadzone_counterweight; }