Skip to content

Commit

Permalink
Fix directions of drawing for symbols in map and radar mode
Browse files Browse the repository at this point in the history
- X axis was reversed in map mode
- Home direction rotation was not corrected for the current heading
in radar mode
  • Loading branch information
fiam committed May 31, 2018
1 parent e45cf00 commit 616ccaa
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 616ccaa

Please sign in to comment.