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:
@@ -337,20 +337,20 @@ MouseDevice::_ComputeAcceleration(const mouse_movement& movements,
|
|||||||
// acceleration
|
// acceleration
|
||||||
double acceleration = 1;
|
double acceleration = 1;
|
||||||
if (fSettings.accel.accel_factor) {
|
if (fSettings.accel.accel_factor) {
|
||||||
acceleration = sqrt(deltaX * deltaX + deltaY * deltaY)
|
acceleration = 1 + sqrt(deltaX * deltaX + deltaY * deltaY)
|
||||||
* fSettings.accel.accel_factor / 524288.0;
|
* fSettings.accel.accel_factor / 524288.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure that we move at least one pixel (if there was a movement)
|
// make sure that we move at least one pixel (if there was a movement)
|
||||||
if (deltaX > 0)
|
if (deltaX > 0)
|
||||||
deltaX = (int32)ceil(deltaX * acceleration);
|
|
||||||
else
|
|
||||||
deltaX = (int32)floor(deltaX * acceleration);
|
deltaX = (int32)floor(deltaX * acceleration);
|
||||||
|
else
|
||||||
|
deltaX = (int32)ceil(deltaX * acceleration);
|
||||||
|
|
||||||
if (deltaY > 0)
|
if (deltaY > 0)
|
||||||
deltaY = (int32)ceil(deltaY * acceleration);
|
|
||||||
else
|
|
||||||
deltaY = (int32)floor(deltaY * acceleration);
|
deltaY = (int32)floor(deltaY * acceleration);
|
||||||
|
else
|
||||||
|
deltaY = (int32)ceil(deltaY * acceleration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user