Commit 69d14982 authored by Lorenz Meier's avatar Lorenz Meier

Joystick: Ensure range given to trigonometric functions is bounded

parent d05b54d7
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment