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
This commit is contained in:
Axel Dörfler 2006-08-24 09:37:16 +00:00
parent 37f49a44b4
commit fafab8272d

View File

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