Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Carry acceleration input offsets to easing curves.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryochan7 committed Jan 5, 2016
1 parent 1454100 commit 56db8d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/joybutton.cpp
Expand Up @@ -1202,7 +1202,7 @@ void JoyButton::mouseEvent()
if (temp <= 0.4)
{
// Low slope value for really slow acceleration
difference = difference * 0.36;
difference = difference * 0.4;

// Out of high end. Reset easing status.
if (buttonslot->isEasingActive())
Expand All @@ -1211,11 +1211,11 @@ void JoyButton::mouseEvent()
buttonslot->getEasingTime()->restart();
}
}
else if (temp <= 0.8)
else if (temp <= 0.75)
{
// Perform Linear accleration with an appropriate
// offset.
difference = difference - 0.256;
difference = difference - 0.24;

// Out of high end. Reset easing status.
if (buttonslot->isEasingActive())
Expand All @@ -1224,7 +1224,7 @@ void JoyButton::mouseEvent()
buttonslot->getEasingTime()->restart();
}
}
else if (temp > 0.8)
else if (temp > 0.75)
{
// Gradually increase the mouse speed until the specified elapsed duration
// time has passed.
Expand Down Expand Up @@ -1262,8 +1262,8 @@ void JoyButton::mouseEvent()

// Allow gradient control on the high end of an axis.
difference = elapsedDiff * difference;
// Range 0.545 - 1.5
difference = difference * 1.365714286 - 0.548571429;
// Range 0.51 - 1.5
difference = difference * 1.32 - 0.48;
}
break;
}
Expand Down

0 comments on commit 56db8d8

Please sign in to comment.