diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/drivers/mouse.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index dac29c78f..9fb824baf 100644 --- 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) { | |||
| 160 | last_mouse_change.y += mouse_change.y * y_sensitivity; | 160 | last_mouse_change.y += mouse_change.y * y_sensitivity; |
| 161 | 161 | ||
| 162 | // Bind the mouse change to [0 <= deadzone_counterweight <= 1.0] | 162 | // Bind the mouse change to [0 <= deadzone_counterweight <= 1.0] |
| 163 | if (last_mouse_change.Length() < deadzone_counterweight) { | 163 | const float length = last_mouse_change.Length(); |
| 164 | last_mouse_change /= last_mouse_change.Length(); | 164 | if (length < deadzone_counterweight && length != 0.0f) { |
| 165 | last_mouse_change /= length; | ||
| 165 | last_mouse_change *= deadzone_counterweight; | 166 | last_mouse_change *= deadzone_counterweight; |
| 166 | } | 167 | } |
| 167 | 168 | ||