* Apply the same trick to the acceleration value, too.

* When reading the settings, get smoother values also.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26868 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-08-07 19:03:06 +00:00
parent 8715a6ad9c
commit 5c1147db87
2 changed files with 6 additions and 4 deletions

View File

@ -161,7 +161,8 @@ MouseWindow::MessageReceived(BMessage *message)
int32 value;
if (message->FindInt32("be:value", &value) == B_OK) {
// slow = 8192, fast = 524287
fSettings.SetMouseSpeed((int32)pow(2, (double)value * 6 / 1000) * 8192);
fSettings.SetMouseSpeed((int32)pow(2,
value * 6.0 / 1000) * 8192);
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
fRevertButton->SetEnabled(true);
}
@ -173,7 +174,8 @@ MouseWindow::MessageReceived(BMessage *message)
int32 value;
if (message->FindInt32("be:value", &value) == B_OK) {
// slow = 0, fast = 262144
fSettings.SetAccelerationFactor((int32)pow(value * 4 / 1000, 2) * 16384);
fSettings.SetAccelerationFactor((int32)pow(
value * 4.0 / 1000, 2) * 16384);
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
fRevertButton->SetEnabled(true);
}

View File

@ -283,11 +283,11 @@ SettingsView::UpdateFromSettings()
// slow = 1000000, fast = 0
fClickSpeedSlider->SetValue(value);
value = int32((log(fSettings.MouseSpeed() / 8192) / log(2)) * 1000 / 6);
value = int32((log(fSettings.MouseSpeed() / 8192.0) / log(2)) * 1000 / 6);
// slow = 8192, fast = 524287
fMouseSpeedSlider->SetValue(value);
value = int32(sqrt(fSettings.AccelerationFactor() / 16384) * 1000 / 4);
value = int32(sqrt(fSettings.AccelerationFactor() / 16384.0) * 1000 / 4);
// slow = 0, fast = 262144
fAccelerationSlider->SetValue(value);