mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Merge pull request #542 from Sarijen/main
Fix RSSI level line overlapping BW text in spectrum
This commit is contained in:
1 file changed
+7
-1
+7
-1
@@ -1728,17 +1728,23 @@ static uint8_t GetScanStepTextWidth()
|
||||
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)
|
||||
{
|
||||
if (settings.rssiTriggerLevel == RSSI_MAX_VALUE || monitorMode)
|
||||
return;
|
||||
uint8_t scanStepTextWidth = GetScanStepTextWidth();
|
||||
uint8_t bwTextWidth = GetBwTextWidth();
|
||||
uint8_t y = Rssi2Y(settings.rssiTriggerLevel);
|
||||
for (uint8_t x = 0; x < 128; x += 2)
|
||||
{
|
||||
if (SpectrumColumnAtOrAboveY(topY, x, y))
|
||||
continue;
|
||||
if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 114))
|
||||
if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 128 - bwTextWidth - 2))
|
||||
continue;
|
||||
if (gFrameBuffer[y / 8][x] & (1 << (y % 8)))
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user