Browse Source

Joystick: Ensure range given to trigonometric functions is bounded

QGC4.4
Lorenz Meier 10 years ago
parent
commit
69d14982e5
  1. 2
      src/Joystick/Joystick.cc

2
src/Joystick/Joystick.cc

@ -239,7 +239,7 @@ float Joystick::_adjustRange(int value, Calibration_t calibration) @@ -239,7 +239,7 @@ float Joystick::_adjustRange(int value, Calibration_t calibration)
<< axisLength;
#endif
return correctedValue;
return std::max(-1.0f, std::min(correctedValue, 1.0f));
}

Loading…
Cancel
Save