Merge pull request #542 from Sarijen/main

Fix RSSI level line overlapping BW text in spectrum
This commit is contained in:
Armel FAUVEAU authored and GitHub committed 2026-09-10 13:48:47 +02:00
commit e5f6fb236b
1 file changed
+7 -1
+7 -1
View File
@@ -1728,17 +1728,23 @@ static uint8_t GetScanStepTextWidth()
return (sprintf(NULL, "%u", GetScanStep() / 100) + 4) * 4; // "%u.%02uk", 4 px advance per char return (sprintf(NULL, "%u", GetScanStep() / 100) + 4) * 4; // "%u.%02uk", 4 px advance per char
} }
static uint8_t GetBwTextWidth()
{
return (strlen(bwOptions[settings.listenBw]) * 4) + 4; // 4 px advance per char
}
static void DrawRssiTriggerLevel(const uint8_t *topY) static void DrawRssiTriggerLevel(const uint8_t *topY)
{ {
if (settings.rssiTriggerLevel == RSSI_MAX_VALUE || monitorMode) if (settings.rssiTriggerLevel == RSSI_MAX_VALUE || monitorMode)
return; return;
uint8_t scanStepTextWidth = GetScanStepTextWidth(); uint8_t scanStepTextWidth = GetScanStepTextWidth();
uint8_t bwTextWidth = GetBwTextWidth();
uint8_t y = Rssi2Y(settings.rssiTriggerLevel); uint8_t y = Rssi2Y(settings.rssiTriggerLevel);
for (uint8_t x = 0; x < 128; x += 2) for (uint8_t x = 0; x < 128; x += 2)
{ {
if (SpectrumColumnAtOrAboveY(topY, x, y)) if (SpectrumColumnAtOrAboveY(topY, x, y))
continue; continue;
if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 114)) if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 128 - bwTextWidth - 2))
continue; continue;
if (gFrameBuffer[y / 8][x] & (1 << (y % 8))) if (gFrameBuffer[y / 8][x] & (1 << (y % 8)))
continue; continue;