diff --git a/src/main/io/osd.c b/src/main/io/osd.c index dfc41763d..4ce33c06c 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -712,7 +712,10 @@ static bool osdDrawSingleElement(uint8_t item) int pitchAngle = constrain(attitude.values.pitch, -maxPitch, maxPitch); // Convert pitchAngle to y compensation value // (maxPitch / 25) divisor matches previous settings of fixed divisor of 8 and fixed max AHI pitch angle of 20.0 degrees - pitchAngle = ((pitchAngle * 25) / maxPitch) - 41; // 41 = 4 * AH_SYMBOL_COUNT + 5 + if (maxPitch > 0) { + pitchAngle = ((pitchAngle * 25) / maxPitch); + } + pitchAngle -= 41; // 41 = 4 * AH_SYMBOL_COUNT + 5 for (int x = -4; x <= 4; x++) { const int y = ((-rollAngle * x) / 64) - pitchAngle;