Permalink
Browse files

[Input] Fixed off-by-one error in internal max axes/buttons

  • Loading branch information...
1 parent 0e7f237 commit 41a23ca371560525492de84243603cc0fff32f3c @thefiddler thefiddler committed Jan 30, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/OpenTK/Input/JoystickState.cs
View
4 Source/OpenTK/Input/JoystickState.cs
@@ -40,8 +40,8 @@ public struct JoystickState : IEquatable<JoystickState>
{
// If we ever add more values to JoystickAxis or JoystickButton
// then we'll need to increase these limits.
- internal const int MaxAxes = (int)JoystickAxis.Last;
- internal const int MaxButtons = (int)JoystickButton.Last;
+ internal const int MaxAxes = (int)JoystickAxis.Last + 1;
+ internal const int MaxButtons = (int)JoystickButton.Last + 1;
const float ConversionFactor = 1.0f / (short.MaxValue + 0.5f);

0 comments on commit 41a23ca

Please sign in to comment.