Commit a106d226 authored by Nick Anthony's avatar Nick Anthony

Fixed formatting of nesting if else statemtents

parent 96c3ca94
...@@ -342,9 +342,13 @@ float Joystick::_adjustRange(int value, Calibration_t calibration, bool withDead ...@@ -342,9 +342,13 @@ float Joystick::_adjustRange(int value, Calibration_t calibration, bool withDead
float axisPercent; float axisPercent;
if (withDeadbands) { if (withDeadbands) {
if (valueNormalized>calibration.deadband) axisPercent = (valueNormalized - calibration.deadband) / (axisLength - calibration.deadband); if (valueNormalized>calibration.deadband) {
else if (valueNormalized<-calibration.deadband) axisPercent = (valueNormalized + calibration.deadband) / (axisLength - calibration.deadband); axisPercent = (valueNormalized - calibration.deadband) / (axisLength - calibration.deadband);
else axisPercent = 0.f; } else if (valueNormalized<-calibration.deadband) {
axisPercent = (valueNormalized + calibration.deadband) / (axisLength - calibration.deadband);
} else {
axisPercent = 0.f;
}
} }
else { else {
axisPercent = valueNormalized / axisLength; axisPercent = valueNormalized / axisLength;
......
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