]> git.tdb.fi Git - libs/gui.git/commitdiff
Fix incorrect comparisons
authorMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 11:21:18 +0000 (13:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 11:21:18 +0000 (13:21 +0200)
source/input/device.cpp

index 10f8d0cf16ff1346d57918d1bd6fbe828b58c08e..228313616c62a92b0bb75d0c370f224944c4b883 100644 (file)
@@ -12,7 +12,7 @@ Device::~Device()
 
 bool Device::get_button_state(unsigned btn) const
 {
-       if(btn>buttons.size())
+       if(btn>=buttons.size())
                return false;
 
        return buttons[btn];
@@ -20,7 +20,7 @@ bool Device::get_button_state(unsigned btn) const
 
 float Device::get_axis_value(unsigned axis) const
 {
-       if(axis>axes.size())
+       if(axis>=axes.size())
                return 0;
 
        return axes[axis];