Implement isHighResolution in place of SCREEN_WIDTH > 128 checks

This commit is contained in:
Jason P
2025-06-22 19:54:47 -05:00
parent d3e56ea084
commit 2de08bebdc
11 changed files with 66 additions and 68 deletions

View File

@@ -4,6 +4,7 @@
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "graphics/ScreenFonts.h"
#include "graphics/SharedUIDisplay.h"
#include <cmath>
namespace graphics
@@ -45,7 +46,7 @@ void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY,
// This could draw a "N" indicator or north arrow
// For now, we'll draw a simple north indicator
// const float radius = 17.0f;
if (display->width() > 128) {
if (isHighResolution) {
radius += 4;
}
Point north(0, -radius);
@@ -55,7 +56,7 @@ void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY,
display->setFont(FONT_SMALL);
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setColor(BLACK);
if (display->width() > 128) {
if (isHighResolution) {
display->fillRect(north.x - 8, north.y - 1, display->getStringWidth("N") + 3, FONT_HEIGHT_SMALL - 6);
} else {
display->fillRect(north.x - 4, north.y - 1, display->getStringWidth("N") + 2, FONT_HEIGHT_SMALL - 6);