Skip to content

Commit

Permalink
Merge pull request iNavFlight#3305 from iNavFlight/agh_fix_map_radar_…
Browse files Browse the repository at this point in the history
…directions

Fix directions of drawing for symbols in map and radar mode
  • Loading branch information
fiam authored Jun 6, 2018
2 parents 0e0dba5 + 616ccaa commit 544e03b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ static void osdDrawMap(int referenceHeading, uint8_t referenceSym, uint8_t cente
int points = poiDistance / (float)(scale / charHeight);

float pointsX = points * poiSin;
int poiX = midX + roundf(pointsX / charWidth);
int poiX = midX - roundf(pointsX / charWidth);
if (poiX < minX || poiX > maxX) {
continue;
}
Expand Down Expand Up @@ -1007,7 +1007,7 @@ static void osdDrawHomeMap(int referenceHeading, uint8_t referenceSym, uint16_t
static void osdDrawRadar(uint16_t *drawn)
{
int16_t reference = DECIDEGREES_TO_DEGREES(osdGetHeading());
int16_t poiDirection = osdGetHeadingAngle(GPS_directionToHome + 180);
int16_t poiDirection = osdGetHeadingAngle(GPS_directionToHome - osdGetHeading() + 180);
osdDrawMap(reference, 0, SYM_ARROW_UP, GPS_distanceToHome, poiDirection, SYM_HOME, drawn);
}

Expand Down

0 comments on commit 544e03b

Please sign in to comment.