From fafab8272d6c38ecabd671a9fe8bc4b765836500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 24 Aug 2006 09:37:16 +0000 Subject: [PATCH] This should actually fix the bug a bit nicer (as it no longer prevents the mouse from moving at all when moved slowly). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18599 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../input_server/devices/mouse/MouseInputDevice.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp index 59c7ce0c58..6ff182f66e 100644 --- a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp +++ b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp @@ -337,20 +337,20 @@ MouseDevice::_ComputeAcceleration(const mouse_movement& movements, // acceleration double acceleration = 1; if (fSettings.accel.accel_factor) { - acceleration = sqrt(deltaX * deltaX + deltaY * deltaY) + acceleration = 1 + sqrt(deltaX * deltaX + deltaY * deltaY) * fSettings.accel.accel_factor / 524288.0; } // make sure that we move at least one pixel (if there was a movement) if (deltaX > 0) - deltaX = (int32)ceil(deltaX * acceleration); - else deltaX = (int32)floor(deltaX * acceleration); + else + deltaX = (int32)ceil(deltaX * acceleration); if (deltaY > 0) - deltaY = (int32)ceil(deltaY * acceleration); - else deltaY = (int32)floor(deltaY * acceleration); + else + deltaY = (int32)ceil(deltaY * acceleration); }