1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Move the Altitude alignment left in the OSD

This commit is contained in:
Miguel Angel Mulero Martinez 2019-05-24 08:22:40 +02:00
parent e54ef4815a
commit f27a93b767
2 changed files with 14 additions and 10 deletions

View file

@ -211,9 +211,12 @@ static void osdFormatAltitudeString(char * buff, int32_t altitudeCm)
{
const int alt = osdGetMetersToSelectedUnit(altitudeCm) / 10;
tfp_sprintf(buff, "%c%5d %c", SYM_ALTITUDE, alt, osdGetMetersToSelectedUnitSymbol());
buff[6] = buff[5];
buff[5] = '.';
int pos = 0;
buff[pos++] = SYM_ALTITUDE;
if (alt < 0) {
buff[pos++] = '-';
}
tfp_sprintf(buff + pos, "%01d.%01d%c", abs(alt) / 10 , abs(alt) % 10, osdGetMetersToSelectedUnitSymbol());
}
#ifdef USE_GPS