Fixed cluttered GPS display if right-aligned.

This commit is contained in:
Raphael Coeffic
2021-06-20 09:32:10 +02:00
parent 1d050efa6d
commit f3b50c177c
2 changed files with 6 additions and 7 deletions
+5 -6
View File
@@ -317,17 +317,16 @@ coord_t drawGPSCoord(BitmapBuffer * dc, coord_t x, coord_t y, int32_t value, con
} }
*tmp++ = direction[value>=0 ? 0 : 1]; *tmp++ = direction[value>=0 ? 0 : 1];
*tmp = '\0'; *tmp = '\0';
x += dc->drawText(x, y, s, flags); x = dc->drawText(x, y, s, flags);
return x; return x;
} }
void drawGPSPosition(BitmapBuffer * dc, coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags) void drawGPSPosition(BitmapBuffer * dc, coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags)
{ {
if (flags & EXPANDED) { if (flags & RIGHT) {
drawGPSCoord(dc, x, y, latitude, "NS", flags, true); x = drawGPSCoord(dc, x, y, longitude, "EW", flags, false);
drawGPSCoord(dc, x, y + FH, longitude, "EW", flags, true); drawGPSCoord(dc, x - 5, y, latitude, "NS", flags, false);
} } else {
else {
x = drawGPSCoord(dc, x, y, latitude, "NS", flags, false); x = drawGPSCoord(dc, x, y, latitude, "NS", flags, false);
drawGPSCoord(dc, x + 5, y, longitude, "EW", flags, false); drawGPSCoord(dc, x + 5, y, longitude, "EW", flags, false);
} }